Implementation functions such as: back end return 1234 table displayed as 1,234 paste the official document address element.eleme.cn/#/zh-CN/com…

It’s mentioned on the website

<el-table-column prop="address" label=" address" :formatter="formatter"> </el-table-column>Copy the code
methods: { formatter(row, column) { return row.address; }}Copy the code

Add this to the el-table-column that needs to be converted

:formatter="stateFormat"

Copy the code
stateFormat (row, column, cellValue) { cellValue += '' if (! cellValue.includes('.')) cellValue += '.' return cellValue.replace(/(\d)(? =(\d{3})+\.) /g, function ($0, $1) { return $1 + ',' }).replace(/\.$/, '') },Copy the code