• art-template 案例语法,注意标签左右有空格


    {{ each target }}
        {{ $index }} {{ $value }}
    {{ /each }}
    
    <script src="/src/art-template.js"></script>
    
    <script id="piyue_art_id" type="text/html">
        <table class="table table-striped table-bordered table-hover">
            <thead>
            <tr class="success">
                <th>ID</th>
                <th>身份</th>
                <th>姓名</th>
                <th>批阅内容</th>
                <th>批阅时间</th>
            </tr>
            </thead>
            <tbody>
                {{ each data }}
                <tr>
                    <td>{{ $value['id'] }}</td> 
                    <td>{{ $value['type_str'] }}</td> 
                    <td>{{ $value['u_name'] }}</td> 
                    <td>{{ $value['remark'] }}</td> 
                    <td>{{ $value['sign_time_str'] }}</td> 
                </tr>
                {{ /each }}
            </tbody>
        </table>
    
    </script>
    
    
    
    $.ajax({
                    type:'POST',
                    url:'piyue_info',
                    data: {id: id},
                    dataType:'json',
                    success:function(data){
                        if(data.errno == 0){
                            var html = template("piyue_art_id",data);
                            console.log(html);
    
                            // 自定页
                            layer.open({
                                type: 1,
                                skin: 'layui-layer-demo', //样式类名
                                closeBtn: 1, //不显示关闭按钮
                                area: ['800px', '300px'], //宽高
                                anim: 2,
                                shadeClose: true, //开启遮罩关闭
                                content: html
                            });
    
                        } else {
                            layer.msg(data.errdesc);
                            return false;
                        }
                    }
                });
    
    • 注意标签左右有空格
    相信坚持的力量,日复一日的习惯.
  • 相关阅读:
    自适应行高
    IOS各类问题
    KVC
    数据模型的构建及懒加载数据
    NSBundle
    九宫格布局获取行/列索引
    QLineEdit
    QLabel
    排序算法
    SpringBoot配置文件-yaml
  • 原文地址:https://www.cnblogs.com/pansidong/p/15118288.html
Copyright © 2020-2023  润新知