【发布时间】:2018-03-24 19:52:24
【问题描述】:
我的项目结构
index.js
views
------partials
--------login
--------footer
------pages
---------index
现在我正在通过
渲染 index.ejsres.render('pages/index',{template:'../partials/login'})}
在 index.ejs 我有
<% include (template) %>
我收到此错误Error: Could not find include include file.
我已将视图缓存设置为 false。这些是我的项目依赖项
"dependencies": {
"ejs": "^2.5.7",
"express": "^4.16.3",
"express-generator": "^4.16.0"}
我尝试给绝对路径不起作用。有什么建议吗?
【问题讨论】:
标签: javascript node.js express ejs