element-ui el-table 添加数字千位分割

html
在需要添加分割号的地方:formatter="stateFormat"

 
      
 

js
在module里面添加如下代码片段

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

element-ui el-table 添加数字千位分割_第1张图片

你可能感兴趣的:(前端UI(PC),vue)