art-template 模板引擎自定义函数 调用js函数 且不转义输出html 原始输出

一、自定义函数

template.defaults.imports.自定义函数名称=function(你的参数){
    
    
}

例子
在这里插入图片描述
使用
在这里插入图片描述

二、原始输出

{
    
    {
    
    @你的数据名称}}

例子如下,因为返回的是html,不原始输出层渲染不了
在这里插入图片描述

三、文档具体可参考

https://github.com/aui/art-template/tree/4.0.0

猜你喜欢

转载自blog.csdn.net/weixin_43205308/article/details/134557211