res.render('user', {
title : user.name,
posts : posts
});
在user.ejs 中<%- partial('posts') %> 包含posts.ejs
在posts.ejs 中却获取不到posts 参数?为什么?各位大虾 求解..
<%= posts%> 为undefined
回复 (3)
Y
partial 新版中依旧没有这个了貌似,看看文档去。那个书中的版本和现在的用法有区别呢
N
换为 partial('posts', {posts:posts})
N
参与回复
登录后即可参与回复。登录