如下所示:
{field: 'username', title: '用戶名', width:80,style:'height:100px;',templet: '#titleTpl'}然后再最后加上
<script type="text/html" id="titleTpl"> {{# if(d.username=='user-0'){ }} 轉(zhuǎn)義用戶0{{# } else if(d.username=='user-1') { }} 轉(zhuǎn)義用戶1{{# } else if(d.username=='user-2') { }}嘎哈{{# } else{}}其他{{# } }} </script>即可轉(zhuǎn)義,如圖所示:狀態(tài)列即為轉(zhuǎn)義后顯示中文‘有效'

以上這篇layui table設(shè)置前臺過濾轉(zhuǎn)義等方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持武林網(wǎng)。
新聞熱點(diǎn)
疑難解答