<el-tag :type="scope.row.hxTag | formatType">{{ scope.row.hxTag }}</el-tag> filters: { formatType(value) { const tags = [ { text: "单质", type: "" }, { text: "氧化物", type: "success" }, { text: "酸", type: "info" }, { text: "碱", type: "warning" }, { text: "盐", type: "danger" } ]; return tags.find(e => e.text == value).type; } }