layUI数据表格显示值与实际值(如1代表男、2代表女,或者1代表超级管理员,2代表普通用户)下面是核心代码
, cols: [[ //表头 { type: 'checkbox', fixed: 'left' } , { field: 'ID', title: 'ID', width: 80, sort: true, fixed: 'left' } , { field: 'UserName', title: '用户名', width: 150 } , { field: 'UserPwd', title: '密码', width: 280 } , { field: 'NickName', title: '昵称', width: 80 } , { field: 'Power', title: '权限', width: 100, templet: function (d) { if (d.Power == 1) { return '超级管理员' } else if (d.Power == 2) { return '普通用户' } else { return '禁用用户' } } } , { field: 'UserKey', title: '用户密钥', width: 300 } ]]