diff --git a/src/css/layui.css b/src/css/layui.css index b0ff68a8..70378482 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -781,6 +781,7 @@ a cite{font-style: normal; *cursor:pointer;} .layui-input-wrap .layui-input-prefix, .layui-input-wrap .layui-input-suffix, .layui-input-wrap .layui-input-split{pointer-events: none;} +.layui-input-wrap .layui-input:hover + .layui-input-split{border-color: #d2d2d2;} .layui-input-wrap .layui-input:focus + .layui-input-split{border-color: #16b777;} .layui-input-wrap .layui-input-prefix.layui-input-split{border-width: 0; border-right-width: 1px;} @@ -791,6 +792,17 @@ a cite{font-style: normal; *cursor:pointer;} .layui-input-affix .layui-icon-clear{color: rgba(0,0,0,.3);} .layui-input-affix .layui-icon:hover{color: rgba(0,0,0,.6);} +/* 数字输入框动态点缀 */ +.layui-input-number{width: 24px; padding: 0;} +.layui-input-number .layui-icon{position: absolute; right: 0; width: 100%; height: 50%; line-height: normal; font-size: 12px;} +.layui-input-number .layui-icon:before{position: absolute; left: 50%; top: 50%; margin-top: -6px; margin-left: -6px;} +.layui-input-number .layui-icon:first-child{top: 0; border-bottom: 1px solid #eee;} +.layui-input-number .layui-icon:last-child{bottom: 0;} +.layui-input-number .layui-icon:hover{font-weight: 700;} +.layui-input-wrap .layui-input[type="number"]::-webkit-outer-spin-button, +.layui-input-wrap .layui-input[type="number"]::-webkit-inner-spin-button{-webkit-appearance: none !important;} +.layui-input-wrap .layui-input[type="number"]{-moz-appearance: textfield;} + /* 下拉选择 */ diff --git a/src/modules/form.js b/src/modules/form.js index 38e44887..7e774a8e 100644 --- a/src/modules/form.js +++ b/src/modules/form.js @@ -162,6 +162,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){ elemForm.find('input[lay-affix],textarea[lay-affix]').each(function(){ var othis = $(this); var affix = othis.attr('lay-affix'); + var CLASS_WRAP = 'layui-input-wrap'; var CLASS_SUFFIX = 'layui-input-suffix'; var CLASS_AFFIX = 'layui-input-affix'; var disabled = othis.is('[disabled]') || othis.is('[readonly]'); @@ -179,17 +180,32 @@ layui.define(['lay', 'layer', 'util'], function(exports){ value: affix }), opts, lay.options(othis[0])); var elemAffix = $('