js:
let testMap=new?Map()
this.testMap.set(1,?'通用質(zhì)檢')
this.testMap.set(2,?'特殊質(zhì)檢')
vue:
使用Map后的判斷:
?<template?slot-scope="{?row?}"?slot="businessType">
? ? ?<div>{{testMap.get(row.businessType)}}</div>
</template>
早期判斷:
?<template?slot-scope="{?row?}"?slot="businessType">
? ? ? ? ? ? ? ? ? <div?v-if="row.businessType=='1'">通用質(zhì)檢項(xiàng)目</div>
??????????????????<div??v-if="row.businessType=='2'">特殊質(zhì)檢項(xiàng)目</div>?
?</template>