class通过计算属性传参动态添加不同样式
<view :class="[_setType(item.type)]"></view>
_setType() {
const className = ['v-flow-item', 'v-flow-item success', 'v-flow-item error']
return function(n) {
return className[n]
}
}
60022转换成6.002万元
<text>{{policyRedemptionAmount}}</text>
<text class="tips">万元</text>
// js
policyRedemptionAmount: Math.round((res.data.data.policyRedemptionAmount / 10000)*Math.pow(10, 3))/Math.pow(10, 3)
判断传参对象里面的显示几个键值对的方法
const sortType = 0
const sort = 1
const type = 0
const redemptionType = 0
const status = 1
// return回去的对象 零已外的才显示
return{...sortType && {sortType}, ...sort && {sort}, ...type && {type}, ...redemptionType && {redemptionType}, ...status && {status}}