element ui table 枚举值转义,将$nbsp;内容转义成空字符串

在el-table-column中添加:formatter = "problemSourceFormat"
<el-table>
<el-table-column
prop="name"
label="课程名称"
:formatter = "problemSourceFormat"
></el-table-column>
<el-table-column prop="chars" label="关联资源"></el-table-column>
</el-table>
problemSourceFormat方法
problemSourceFormat:function(data){
      if(data.name){
        return data.name.replace(/&nbsp;/ig, " ");
      }
    }

 

posted @ 2021-06-25 11:07  还有什么值得拥有  阅读(918)  评论(0编辑  收藏  举报