根據文檔,傳遞變量到模板中渲染可以通過以下方式:var template = require("pug!./file.pug");// => returns file.pug content as template function// or, if you've bound .pug to pug-loadervar template = require("./file.pug");var locals = { /* ... */ };var html = template(locals);// => the rendered HTML傳遞字符串類型過模板中可以正常渲染出來,請問如何傳遞OBject類型到pug中遍歷輸出內容?
請問pug模板如何遍歷傳遞的數組數據?
慕森卡
2019-02-28 14:11:04