0
我在我的視圖上有對象sumPrice
,我想顯示值取決於鍵。但關鍵必須與grp
的實際值相同。JavaScript中的帕格(jade)模板的動態對象關鍵字node.js
我會更好地解釋如下
- each grp in Object.keys(groupedData)
h3= grp // for example grp has value Fruit
table
thead
th Name
th Price
tfoot
th Sum:
th= sumPrice.grp //this doesn't work, but this: th= sumPrice.Fruit will work!
th
th
tbody
// [........]
我想萬一sumPrice.grp
,申請「sumPrice.grp」,而不是「sumPrice.Fruit」尋找價值 - 不承認一個GRP是可變的。有沒有簡單的解決方案?
太棒了,我試過了:'th = sumSales。[grp]',我忘了刪除點... – DiPix