【发布时间】:2015-10-06 08:17:56
【问题描述】:
我是玉石新手。
我有如下路线
var fortunes = ['a','b','c'];
app.get('/about', function(req, res){
var temp = fortunes[Math.floor(Math.random()*Math.length)];
res.render('about',{fortune:temp});
});
玉文件中如何使用幸运作为key?
我尝试过的 Jade 代码示例:
html
head
title = "about"
body
p1 This is fortune page
blockquote #{fortune}
正在运行的 HandleBars 代码。
<h1>About fortune</h1>
<p>Your fortune for the day:</p>
<blockquote>{{fortune}}</blockquote>
jade中如何直接使用对象键?
【问题讨论】: