JavaScript

超轻量级php框架startmvc

layui 表格的属性的显示转换方法

更新时间:2020-07-21 06:48 作者:startmvc
如下所示:layui.render({url:'/xxxxx',cols:[[{field:'status',title:'状态'}]],done:function(res,curr,count){//res

如下所示:


layui.render({
 url:'/xxxxx'
 ,cols:[[ 
 {field:'status',title:'状态'}
 ]]

,done:function(res, curr, count){ //res 接口返回的信息

 $("[data-field = '属性名(status)']").children().each(function(){

 if($(this).text() == '1'){

 $(this).text("发布");

 }else if($(this).text() == '1'){

 $(this).text("禁用");
 }
 })
})

以上这篇layui 表格的属性的显示转换方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。