html
在需要添加分割号的地方:formatter="stateFormat"
<el-table stripe ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%">
<el-table-column label="注册资金" prop="registeredCapital" :formatter="stateFormat" show-overflow-tooltip></el-table-column>
</el-table>
js
在module里面添加如下代码片段
stateFormat(row, column, cellValue) {
cellValue += '';
if (!cellValue.includes('.')) cellValue += '.';
return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
return $1 + ',';
}).replace(/\.$/, '');
},