//用法
<template slot-scope="scope">
<span>{{ filters(scope.row.goodsPrice) }}</span>
</template>
// 保留两位小数
filters(num) {
if (isNaN(num)) {
this.$message.error("请输入正确的价格");
return Number(0).toFixed(2);
} else {
return Number(num).toFixed(2);
}
},
},
vue封装保留两位小数方法
最新推荐文章于 2024-02-28 09:38:25 发布