博客
关于我
nodejs基于art-template模板引擎生成
阅读量:799 次
发布时间:2023-02-16

本文共 1145 字,大约阅读时间需要 3 分钟。

Art-Template????????

Art-Template??????????????????????HTML?????????????????????????Art-Template?????HTML??????????????????

?????????

Art-Template??????????????????????????????????????????????HTML???????????????????????????????

??Art-Template???

  • ??????

    ???????Art-Template????????????????

    npm install art-template
  • ??????

    ????????????.html??????HTML?????????? {% %} ????????

  • ??????

    ?????????????

        
    {% if title %}???{% endif %}

    {% if title %}?????????{% endif %}

    ???????????

  • ??????????

    ????????????????????????

    const template = require('art-template');const html = template.renderFile('template.html', {    title: '??????'});
  • ????

    ????HTML??????console.log??????????????

  • ??????

    ????????????????????Art-Template??????????

        
    {% if title %}??????{% endif %}

    {% if title %}?????????{% endif %}

    ???????????

    const template = require('art-template');const tName = new Date().getTime();const htmlT = '

    { {title}}

    ';const html = template.renderFile(tName, {title: '????????~'});console.log("??: " + html);

    ??

    ??????????????Art-Template???????HTML??????????????????????????????????????????????????Art-Template?

    转载地址:http://gtjfk.baihongyu.com/

    你可能感兴趣的文章
    numpy.linalg.norm(求范数)
    查看>>
    Numpy.ndarray对象不可调用
    查看>>
    Numpy.VisibleDeproationWarning:从不整齐的嵌套序列创建ndarray
    查看>>
    Numpy:按多个条件过滤行?
    查看>>
    Numpy:条件总和
    查看>>
    numpy、cv2等操作图片基本操作
    查看>>
    numpy中的argsort的用法
    查看>>
    NumPy中的精度:比较数字时的问题
    查看>>
    numpy判断对应位置是否相等,all、any的使用
    查看>>
    Numpy多项式.Polynomial.fit()给出的系数与多项式.Polyfit()不同
    查看>>
    Numpy如何使用np.umprod重写range函数中i的python
    查看>>
    numpy学习笔记3-array切片
    查看>>
    numpy数组替换其中的值(如1替换为255)
    查看>>
    numpy数组索引-ChatGPT4o作答
    查看>>
    numpy最大值和最大值索引
    查看>>
    NUMPY矢量化np.prod不能构造具有超过32个操作数的ufunc
    查看>>
    Numpy矩阵与通用函数
    查看>>
    numpy绘制热力图
    查看>>
    numpy转PIL 报错TypeError: Cannot handle this data type
    查看>>
    Numpy闯关100题,我闯了95关,你呢?
    查看>>