0
如果可能的話,將Jade中的兩個字段相乘將會很好。這是我想要實現的:在JADE中的乘法
tbody
each item in items
tr
td #{item.sku}
td.text-center #{item.price}
td.text-center #{item.quantity}
//td #{item.quantity} * #{item.price}
// - var totals = {item.price} * {item.quantity};
//td #{totals}
td #{item.quantity} * #{item.price}
試過不同的方法,沒有人工作。
完美,但現在我想在結果的最後附上一個美元符號D: –
@JoeYahchouchi,我在很長一段時間內沒有使用過玉器,但是我的猜測會是'td.text-right #{item.quantity * item.price} $'會起作用,不是嗎? –
嗨,感謝您的回覆,我昨天用它解決了這個問題 td = product.price * product.quantity +'LL' (LL是我想補充的貨幣) –