feat: 导出关闭某个标签的hooks

This commit is contained in:
xiaoxian521
2022-04-03 15:30:45 +08:00
parent de76497e8a
commit 5e8723a031
6 changed files with 225 additions and 108 deletions

View File

@@ -89,7 +89,13 @@ export const useMultiTagsStore = defineStore({
}
break;
case "splice":
this.multiTags.splice(position?.startIndex, position?.length);
if (!position) {
const index = this.multiTags.findIndex(v => v.path === value);
if (index === -1) return;
this.multiTags.splice(index, 1);
} else {
this.multiTags.splice(position?.startIndex, position?.length);
}
this.tagsCache(this.multiTags);
return this.multiTags;
case "slice":