//方案1:官网有提供empty-text 没用过你试试把 <el-table empty-text> <el-table-column label="选项/数值/单位"> <template slot="empty"> -- </template> </el-table-column> //方案2: <el-table-column label="选项/数值/单位"> <template slot-scope="scope"> <span v-if=" scope.row.value== '' ">--</span> <span v-else>元</span> </template> </el-table-column>
通用一点就注册1个全局过滤器。 Vue.filter('handleEmpty', function (value) { return value === '' ? '--' : value }) 然后直接用就行了。 {{ msg | handleEmpty }}