素材牛VIP会员
请问pug模板如何遍历传递的数组数据?
 酒***无  分类:JavaScript  人气:1175  回帖:1  发布于6年前 收藏

根据文档,传递变量到模板中渲染可以通过以下方式:

var template = require("pug!./file.pug");
// => returns file.pug content as template function

// or, if you've bound .pug to pug-loader
var template = require("./file.pug");

var locals = { /* ... */ };

var html = template(locals);
// => the rendered HTML

传递字符串类型过模板中可以正常渲染出来,请问如何传递OBject类型到pug中遍历输出内容?

 标签:pugjadejavascript

讨论这个帖子(1)垃圾回帖将一律封号处理……

Lv5 码农
mi***02 学生 6年前#1
 文明上网,理性发言!   😉 阿里云幸运券,戳我领取