目录

template 渲染模板

优质
小牛编辑
121浏览
2023-12-01



说明

调用方法:

  • $.f2e.util.render(temp,data,fn,helper);

函数说明:

调用template渲染模板,依赖于artTemplate库

参数说明:

参数名类型说明备注
tempstringhtml字符串
dataobject参数名
fnfunction回调函数
helperfunctionartTemplate自定义方法

脚本

<script>

    $.f2e.util.render(html,{act:xxx},function(result){
        $("body").html(result);
    },TMHelper)

    function TMHelper(){
        template.helper('$timeunix', function (timenum) {
            var unixTimestamp = new Date(timenum) 
            return unixTimestamp.getFullYear() +'-'+ (unixTimestamp.getMonth()+1) +'-'+ unixTimestamp.getDate() 
        });
    }
</script>