1. 首页
  2. 数据库
  3. 其它
  4. koa underscore templates:使用Koa渲染underscore.js模板 源码

koa underscore templates:使用Koa渲染underscore.js模板 源码

上传者: 2021-04-26 10:06:38上传 ZIP文件 6KB 热度 23次
koa下划线模板 使用Koa渲染模板。 适用于Koa 2.x或更高版本。 入门 将此软件包添加为您的应用程序的中间件: const views = require ( 'koa-underscore-templates' ) ; app . use ( views ( __dirname + '/views' , { // optional options here... } ) ) ; 然后调用ctx.render渲染页面: app . use ( async ( ctx ) => { await ctx . render ( 'index.html' ) ; } ) ;
用户评论