<template>
<div>
<div>{{price | priceFilter}}</div>
<div>{{day | dayFilter}}</div>
</div>
</template>
<script>
export default {
data(){
return{
price:3000,
day:20220101
}
},
filters:{
//priceWidthDelimiter
priceFilter:(value)=>value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
dayFilter:function(value){
return value.toString().replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3');
}
}
}
</script>
<div>{{ value | filterA | filterB }}</div>