【发布时间】:2017-10-23 19:45:55
【问题描述】:
我正在尝试包含一个 ejs 文件,其中包含用于设置我的视图的函数。这些函数被定义为使用助手。我试过使用:
<% include helpers.ejs %>
但是当我尝试使用这个文件中的函数时:
<% module_start('$body', [{name:'display',value:'block'}], 'body'); %>
我得到错误:
Reference Error: module_start is not defined
当我将代码从“helpers.ejs”复制到我的原始视图文件“test.ejs”时,它按预期工作。我已经经历了几个答案, 在这种情况下,我仍然很困惑我做错了什么。
提前感谢您的帮助。
【问题讨论】:
标签: ejs referenceerror