art-template
码林鼠
致力于知识的传播
展开
-
express-art-template服务端渲染
我们都知道,在用node写服务器的时候,要用http来创建服务,然而,为了方便开发,有人对http进行了封装,于是就有了express。那么怎么在express中使用art-template,那就要用到express-art-template进行服务端渲染。首先,要在项目中用npm安装express,art-template,express-art-template然后在命令行执行命令node app.js启动服务访问:服务端在渲染的时候就会找到项目中views文件中的页面进行渲染ap原创 2020-12-27 20:59:27 · 212 阅读 · 0 评论 -
前端模板引擎art-template
首先在项目根目录打开命令行,用npm i art-template安装art-template模板引擎,然后新建文件test.html用script引入模板引擎看效果:上代码:<script src="node_modules/_art-template@4.13.2@art-template/lib/template-web.js"></script> <script type="text/template" id="tplId">原创 2020-12-27 17:30:22 · 120 阅读 · 0 评论