性能没有受到影响,但最终会得到混乱的代码。
如果出现“第3节”怎么办?另一个如果?
那么...怎么样
<head>
<title>{{title}}</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/section1.css" rel="stylesheet">
<link href="css/section{{section}}.css" rel="stylesheet">
</head>
router.get('/section1', function(req, res){
res.render('section1',{title: 'Section 1', section: "1"});
});
或
router.get('/section2', function(req, res){
res.render('section2',{title: 'Section 2', section: "2"});
});