我正在使用node.js,用jade / pug表达。
作为一个例子,我在index.js文件中有以下内容。
res.render('index', { x: 'home' });
作为确保我正确传递值的测试,我使用以下内容在index.pug上显示值'home'。
#{x}
这会将值呈现为标记主页。
<home></home> instead of the word home
我如何获得主页而不是标签? 我如何将价值纳入
include ../components/#{x}.pug