This commit is contained in:
hmol233
2021-05-24 23:33:27 +08:00
parent a52c6c5afc
commit 43ef4990f5
3 changed files with 12 additions and 17 deletions
+3 -8
View File
@@ -19,18 +19,13 @@ export default defineComponent({
},
},
data() {
let tag = this.title;
return {
tabID: "",
labelID: "",
tabID: tag,
labelID: tag + "-" + "label",
};
},
beforeMount() {
let tag = "tab-" + Math.random().toString(36).substring(2);
this.tabID = tag;
this.labelID = tag + "-" + "label";
// Since Vue 3.0, we have no access to $children.
// So we need another approach to register our child components.
this.$parent.$data.children.push(this);
},
});