1、html代码如下,不要忘记 lay-filter属性
<div class="layui-input-block">
<select id="brickType" lay-filter="brickType">
<option value="0">--请选择型号--</option>
<option value="ty1">型号1</option>
<option value="ty2">型号2</option>
<option value="ty3">型号3</option>
</select>
</div>
2、javascirpt代码如下
layui.use(['form'], function() {
form=layui.form;
form.on('select(brickType)', function(data){
var val=data.value;
console.info(val);
});
});
原文链接:https://blog.csdn.net/qq_33643690/article/details/82178823
更多参考:https://www.layui.com/doc/modules/form.html#onselect