用过滤器对订单状态进行定义
作者:互联网
<template>
<p>
{{status|orderStatusFormat}}
</p>
</template>
<script>
const ORDER_STATUS={
'1':'下单成功',
'2':'商家已接单',
'3':'已发货',
'-1':'订单已取消'
}
props:{},
filter:{
orderStatusFormat(statusCode){
return ORDER_STATUS[statusCode]
}
},
data(){
return{
status:1
//status:-1
//status:2
//status:3
}
}
</script>
标签:status,STATUS,orderStatusFormat,return,定义,订单,过滤器,ORDER,statusCode 来源: https://blog.csdn.net/taotaobaobei/article/details/114122207