Node.js Express haml 无法正确渲染
我针对此问题的存储库位于: https://github.com/okor/express_bad_haml
问题是我可以让应用程序正确渲染布局或页面,但不能同时渲染两者。结果是: http://farm8.staticflickr.com/7170/6818833785_80bcc2b2fe_z.jpg
我不确定我做错了什么。帮助?
My repo for this problem is at: https://github.com/okor/express_bad_haml
The problem is that I can get the app to render the layout correctly, or the page, but not both. Resulting in this: http://farm8.staticflickr.com/7170/6818833785_80bcc2b2fe_z.jpg
I'm not sure what I'm doing wrong. Help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的浏览器似乎正在尝试将输出呈现为纯文本。尝试强制输出标头为 text/html:
It seems like your browser is trying to render the output as plain text. Try to forcing the output header to text/html:
好吧,我明白了。我之前设置过
app.set("视图选项", {layout: true});
我将该设置更改为
app.set("视图选项", {layout: false});
这解决了问题。
Ok, I figured it out. I had previously set
app.set("view options", {layout: true});
I changed that setting to
app.set("view options", {layout: false});
And that fixed the issue.