0
我是新來的nodejs和玉,並遵循一個小博客教程。我在沒有擴展布局的情況下正確使用了玉頁。在我的index.jade中擴展布局的那一刻,頁面變爲空白。任何想法這裏發生了什麼?玉給空頁(沒有錯誤)
Layout.jade:
doctype 5
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
index.jade(不extends layout
)
h1= locals.title
#articles
- each article in locals.articles
div.article
div.created_at= article.created_at
div.title
a(href="/blog/"+article._id)!= article.title
div.body= article.body
而且在app.js渲染
app.get('/', function(req, res) {
articleProvider.findAll(function(error, docs) {
res.render('index.jade', { locals: {
title: "Blog",
articles: docs
}
});
});
});
嘗試檢查,如果你的縮進是正確的 – Ewe
有沒有錯誤。所以它一定是。如果不擴展布局,它就像魅力一樣 – CaptainCarl