Tag: fix 可移除标签不生效问题

pull/22499/head
关跃 2023-04-21 15:51:21 +08:00 committed by GitHub
parent f14b5ba540
commit 550a1f589d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,7 @@
v-for="tag in tags" v-for="tag in tags"
:key="tag.name" :key="tag.name"
closable closable
@close="handleClose(tag)"
:type="tag.type"> :type="tag.type">
{{tag.name}} {{tag.name}}
</el-tag> </el-tag>
@ -40,6 +41,11 @@
{ name: '标签五', type: 'danger' } { name: '标签五', type: 'danger' }
] ]
}; };
},
methods: {
handleClose(tag) {
this.tags.splice(this.tags.indexOf(tag), 1);
}
} }
} }
</script> </script>