2 Star 10 Fork 5

byk/layui_modules

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
number_input.html 4.06 KB
一键复制 编辑 原始数据 按行查看 历史
byk 提交于 2021-04-21 17:13 . 初始化
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>数字输入框</title>
<link rel="stylesheet" href="/js/layui/css/layui.css">
</head>
<body>
<div class="layui-fluid">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-row">
<div class="layui-col-lg12">
<h3>安装代码</h3>
</div>
<div class="layui-col-lg4">
<pre class="layui-code" lay-title="JavaScript">
layui.config({
base:'/js/layui_modules/'
}).extend({
numberInput:'numberInput/numberInput'
});
</pre>
</div>
</div>
<div class="layui-row">
<div class="layui-col-lg12">
<h3>使用方法一</h3>
</div>
<div class="layui-col-lg4">
<input type="text" class="layui-input" number-input>
<p class="layui-word-aux">加上<b>lay-ignore</b>将被忽略</p>
</div>
<div class="layui-col-lg12">
<h3>代码示例</h3>
</div>
<div class="layui-col-lg4">
<pre class="layui-code" lay-title="JavaScript">
layui.use('numberInput',function () {
var numberInput = layui.numberInput;
numberInput.render();
});
</pre>
</div>
</div>
<div class="layui-row">
<div class="layui-col-lg12">
<h3>设置数字限制</h3>
</div>
<div class="layui-col-lg4">
<input type="text" class="layui-input" number-input min="0" max="3" value="0">
</div>
<div class="layui-col-lg12">
<h3>代码示例</h3>
</div>
<div class="layui-col-lg4">
<pre class="layui-code" lay-title="HTML" lay-encode="true">
<input type="text" class="layui-input" number-input min="0" max="3" value="0">
</pre>
</div>
</div>
<div class="layui-row">
<div class="layui-col-lg12">
<h3>设置增加步长</h3>
</div>
<div class="layui-col-lg4">
<input type="text" class="layui-input" number-input step="0.01" value="0.01" autocomplete="off">
</div>
<div class="layui-col-lg12">
<h3>代码示例</h3>
</div>
<div class="layui-col-lg4">
<pre class="layui-code" lay-title="HTML" lay-encode="true">
<input type="text" class="layui-input" number-input step="0.01" value="0.01">
</pre>
</div>
</div>
<div class="layui-row">
<div class="layui-col-lg12">
<h3>渲染指定元素</h3>
</div>
<div class="layui-col-lg4">
<input type="text" class="layui-input" id="example_input" autocomplete="off">
</div>
<div class="layui-col-lg12">
<h3>代码示例</h3>
</div>
<div class="layui-col-lg4">
<pre class="layui-code" lay-title="JavaScript">
layui.use('numberInput',function () {
var numberInput = layui.numberInput;
numberInput.render({
elem:'#example_input'
});
});
</pre>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="/js/layui/layui.js"></script>
<script>
layui.config({
base:'/js/layui_modules/'
}).extend({
numberInput:'numberInput/numberInput'
});
layui.use('numberInput',function () {
var numberInput = layui.numberInput;
numberInput.render();
numberInput.render({
elem:'#example_input'
});
});
layui.code();
</script>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/otherusedemail/layui_modules.git
git@gitee.com:otherusedemail/layui_modules.git
otherusedemail
layui_modules
layui_modules
master

搜索帮助