layui enable disable switch explain

Two days ago I wrote about the melons demo. Official documents looked under layui, and went to the next Baidu, search now to find the answer is not very suitable for white

{{# if(d.isActive == 1){ }} // 这个是layui的模板渲染 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="forbidden">禁用</a> {{# } }} {{# if(d.isActive == 0){ }} // isActive就是后端返回的值的字段 这个由开发的后端同事决定 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="open">启用</a> {{# } }}

layui the table toolbar has a bar operations column, and this column operating in table.render () method used later, his object obj belongs template cols of table.render species.

Popular point is the corresponding fields are now above d.isactive is your own backend interface returned in the template;

Guess you like

Origin www.cnblogs.com/wangjiahui/p/12087816.html