一、在template標簽中增加 :
<template>
……
<el-table-column label="檢索匹配分值" prop="score">
<template slot-scope="scope">{{scope.row.score | formatPrice}}</template>
</el-table-column>
……
</template>
二、 在script標簽中增加:
filters: {
formatPrice: function (value) {
let tempVal = parseFloat(value).toFixed(3)
let realVal = tempVal.substring(0, tempVal.length - 1)
return realVal
}
}
嗯,好了,就到這里了,記錄工作小點滴,讓模棱兩可的事情有處可尋……