1、隐藏中间四位
//prop对应表格数据中的对象的字段名
<el-table-column prop="phone" width="110" label="联系电话">
<template slot-scope="scope">
{{scope.row.phone?scope.row.phone.replace(/(\d{3})(\d{4})(\d{4})/,"$1****$3"):""}}
</template>
</el-table-column>
效果:
2、按3-4-4分组
<el-table-column prop="phone" width="110" label="联系电话">
<template slot-scope="scope">
{{scope.row.phone?scope.row.phone.replace(/(\d{3})(\d{4})(\d{4})/,"$1-$2-$3"):""}}
</template>
</el-table-column>
效果: