app.js里的内容 app.get('/tasks’,function(req,res){ Task.find({},function(err,docs){ res.render('tasks/index’,{ title: ‘Todo index view’, docs: docs }); }); }); 目录结构 -views –tasks —index.jade –layout.jade 在render中不写layout配置,默认不是调用layout的么。 layout.jade内容 html head title= title link(href=’stylesheets/bootstrap.min.css’,type=’text/css’,rel=’stylesheet’) body section.container
14 回复