【发布时间】:2019-05-06 12:17:58
【问题描述】:
我在控制台中看到此错误:
isNaN(...).toFixed 不是函数
这是我用 Vue.js 编写的一些 HTML 代码:
<v-flex xs3 class="text-lg-right"
v-for="(mrp, index) in [medicine.orderedMedView.combinations[combinationIndex]]" :key="index">
<div class="primary-header-font">
₹ {{ isNaN((mrp && (mrp.totalPrice - (mrp.totalPrice * (medicine.discountPercentage / 100))))).toFixed(2) ?
0 :
(( mrp && mrp.totalPrice - (mrp.totalPrice * (medicine.discountPercentage / 100)))).toFixed(2) || 0 }}
</div>
<span v-if="mrp && mrp.totalPrice != NaN" class="secondary-header-font">
{{ medicine.discountPercentage }}%
</span>
<span v-if="mrp && mrp.totalPrice != NaN" class="secondary-header-font strike-through">
₹ {{ mrp && mrp.totalPrice && (mrp.totalPrice).toFixed(2) || 0 }}
</span>
</v-flex>
我猜在我的药物状态下,当我使用它时,响应会延迟......所以也许这就是它说“不是功能”的原因。我该如何解决这个问题?
【问题讨论】:
标签: javascript vue.js vuejs2 tofixed