<div v-for="i in positionLIst" :key="i.id" :class="{'addDiv':addId==i.id}" @click="leftBoxClick(i.id)"> {{i.name}} ({{i.number}})</div> <el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="false" > {{tag}} </el-tag> return { addId: 1, positionLIst: [{ name: '前端', number: '2', id: '1', }, { name: '产品经理', number: '5', id: '2', }, { name: 'UI设计师', number: '8', id: '3', }, { name: 'Android工程师', number: '13', id: '4', }, { name: '商务', number: '46', id: '5', }, { name: 'IOS工程师', number: '10', id: '6', }, { name: 'IOS工程师', number: '10', id: '7', }, { name: 'IOS工程师', number: '10', id: '8', }, { name: 'IOS工程师', number: '10', id: '9', }, { name: 'IOS工程师', number: '10', id: '10', }, { name: 'IOS工程师', number: '10', id: '11', }, { name: 'IOS工程师', number: '10', id: '12', }, { name: 'IOS工程师', number: '10', id: '13', }, ], dynamicTags: [], } methods: { // 点击选择标签 leftBoxClick(id) { this.addId = id; console.log(this.addId, '204') this.lableData(1) }, lableData(){ if(this.addId == 1){ this.dynamicTags = ['挺好', '态度认真', '效率高'] }else{ this.dynamicTags = ['最佳人选', '高潜人才', '待沟通'] } }, } <style type="text/css"> .addDiv { color: #3377FF; } </style>