vue ElementUi表中保留两位小数

在ElementUi表格中使用

 <el-table-column
    prop="testValue"
    label="信息"
    align="center">
    <template slot-scope="scope">
       {{ fun(scope.row.testValue) }}
    </template>
</el-table-column>
methods: {
  fun(val){
    return Number(val).toFixed(2);
  },
}
原文地址:https://www.cnblogs.com/ssjd/p/14927075.html