layui 在script标签中type=“text/html“时进行逻辑判断

我是在layui的table里面使用的

table({
      id :'reasonLeave'
       , elem: '#reasonLeaveViewData'
       , height: 'full-155'
       , toolbar: '#toolbarDemo'
       , defaultToolbar: []
       , url: that.urls.queryReasonLeaveListData //数据接口
       , page: {curr: 1, limit: 20}//重新从第 1 页开始
       , limits: [20, 40, 60, 80, 100, 200, 500]
       , where: {
         
       }
       , cols: [[ //表头z
           {type: 'checkbox'}
           , {type: 'numbers', title: '序号'}
           , {field: 'name', title: '名称', align: 'center'}
           , {field: 'approveStatusStr', title: '状态', align: 'center'}
           , {field: 'approveRemark', title: '审批备注', align: 'center'}
           , {title: '操作', fixed: 'right', align: "center", minWidth: 240, toolbar: '#reasonLeaveToolbar'}
       ]],
       done: function (res, curr, count) {
       }
});
<script id="reasonLeaveToolbar" type="text/html">
 {{# if(d.approveStatus != 1 && d.approveStatus != 2 && d.approveStatus != 3){ }}
    <button type="button" class="layui-btn layui-btn-xs" lay-event="pass">
        <i class="layui-icon layui-icon-ok"></i>审核通过
    </button>
    <button type="button" class="layui-btn layui-btn-xs" style="background-color: red" lay-event="passFailed">
        <i class="layui-icon layui-icon-close"></i>审核不通过
    </button>
    {{# } else { }}
    ......
    {{# }}}
</script>
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值