We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.在命令行中执行$ npm install express-partials 2.安装好后在app.js中 var partials = require('express-partials'); app.set('view engine', 'ejs'); app.use(partials()); 3.layout.ejs中
$ npm install express-partials
var partials = require('express-partials');
app.set('view engine', 'ejs');
app.use(partials());
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ddd</title> </head> <body> <p>dddafaiefaoiedddddd</p> <%- body -%> </body> </html>
4.不同页面指定不同的layout,则在该页面对应的js文件中:
var express = require('express'); var router = express.Router(); router.get('/', function(req, res, next) { res.render('about', { time: '2014-01-12', ceo: 'mili', layout: 'layout2.ejs' //指定对应的layout }); }); module.exports = router;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.在命令行中执行
$ npm install express-partials
2.安装好后在app.js中
var partials = require('express-partials');
app.set('view engine', 'ejs');
app.use(partials());
3.layout.ejs中
4.不同页面指定不同的layout,则在该页面对应的js文件中:
The text was updated successfully, but these errors were encountered: