跳到主要内容
CNode

为什么已经使用了include footer.ejs和include header.ejs,但是在主页没有显示???

社区
Wwangxuq发布于 12 年前最后回复 9 年前
8205560
<% include header.ejs %> <%- body %> <% include footer.ejs %>

难道是格式不正确吗?

查看回复

回复 (8)

M
motecshine#712 年前

chrome F12

B
bigMuffin#612 年前
A
alsotang#512 年前
B
bigMuffin#412 年前

<% include base.ejs %> 这样就可以引入了。 我另外问下,假如不在同一目录怎么引用?

W
wangxuq#212 年前
引用 allen6290建议使用 <% partial('xxx') % 代替 include , 否则 html标签会不完整。

改成这样也不行啊

<%- partial('header')%> <%- body %> <%- partial('footer') %>
A
allen6290#112 年前

建议使用 <%- partial('xxx') %> 代替 include , 否则 html标签会不完整。

参与回复

登录后即可参与回复。登录