第二战场: 前端 实战经验0001

1,关于应用layui的表格的表头添加操作时

例如:

 

操作选项为编辑  删除按钮

 

 

 html页面:

var cols = [
{type:'checkbox'},
{field:'Id',align:'center',title:'编号', width:100},......,
{field:'operation',align:'center',title:'操作', width:50, templet:operation},]

js里的方法:

function operation1(val,row){
var html="";
html = '<a class="f-bg-66cc66" lay-event="operation">删除</a> &nbsp <a class="f-bg-66cc66" lay-event="operation">编辑</a>';
return html;
}

 

posted @ 2020-09-10 20:38  唯恐不及  阅读(111)  评论(0编辑  收藏  举报