html中
<div class="company">
<p>{{ scope.row.name }}</p>
<div
class="tag"
v-for="(item, index) in changeTag(
scope.row.source.split(',')
)"
:key="index"
>
<span>
{{ item }}
</span>
</div>
</div>
js中
changeTag(tag) {
if (tag.indexOf('1') != -1) {
tag.splice(tag.indexOf('1'), 1)
}
if (tag.indexOf('3') != -1) {
tag.splice(tag.indexOf('3'), 1)
}
if (tag.indexOf('5') != -1) {
tag.splice(tag.indexOf('5'), 1)
}
let temp = {
2: '专',
4: '标',
6: '百',
7: '聘',
8: '简',
9: '精',
}
let newArr = [...new Set(tag)].map(item => temp[item])
return newArr
},