fix(#4953): use beforeMount to generate unique component id (#4954)

pull/5098/head
Alexander 2024-01-16 14:28:03 +03:00 committed by GitHub
parent 23360e7654
commit e8b5b8f3e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 43 additions and 28 deletions

View File

@ -79,7 +79,7 @@ export default {
this.d_activeIndex = newValue; this.d_activeIndex = newValue;
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
}, },
methods: { methods: {

View File

@ -223,9 +223,10 @@ export default {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.autoUpdateModel(); this.autoUpdateModel();
}, },
updated() { updated() {

View File

@ -114,9 +114,10 @@ export default {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.autoUpdateModel(); this.autoUpdateModel();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -76,9 +76,10 @@ export default {
} }
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
if (this.global) { if (this.global) {
this.bindDocumentContextMenuListener(); this.bindDocumentContextMenuListener();
} }

View File

@ -110,7 +110,7 @@ export default {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
}, },
methods: { methods: {

View File

@ -215,9 +215,10 @@ export default {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.autoUpdateModel(); this.autoUpdateModel();
this.bindLabelClickListener(); this.bindLabelClickListener();
}, },

View File

@ -156,9 +156,10 @@ export default {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.autoUpdateModel(); this.autoUpdateModel();
}, },
methods: { methods: {

View File

@ -98,8 +98,10 @@ export default {
} }
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.bindMatchMediaListener(); this.bindMatchMediaListener();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -73,9 +73,10 @@ export default {
resizeListener: null, resizeListener: null,
container: null, container: null,
list: null, list: null,
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
if (!this.popup) { if (!this.popup) {
this.bindResizeListener(); this.bindResizeListener();
this.bindOutsideClickListener(); this.bindOutsideClickListener();

View File

@ -93,8 +93,10 @@ export default {
outsideClickListener: null, outsideClickListener: null,
container: null, container: null,
menubar: null, menubar: null,
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.bindMatchMediaListener(); this.bindMatchMediaListener();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -241,9 +241,10 @@ export default {
this.autoUpdateModel(); this.autoUpdateModel();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.autoUpdateModel(); this.autoUpdateModel();
}, },
beforeUnmount() { beforeUnmount() {

View File

@ -116,9 +116,10 @@ export default {
this.reorderDirection = null; this.reorderDirection = null;
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
if (this.responsive) { if (this.responsive) {
this.createStyle(); this.createStyle();
} }

View File

@ -76,7 +76,7 @@ export default {
this.id = newValue || UniqueComponentId(); this.id = newValue || UniqueComponentId();
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
}, },
methods: { methods: {

View File

@ -276,9 +276,10 @@ export default {
this.destroyStyle(); this.destroyStyle();
this.destroyMedia(); this.destroyMedia();
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
if (this.responsive) { if (this.responsive) {
this.createStyle(); this.createStyle();
this.initMedia(); this.initMedia();

View File

@ -84,9 +84,10 @@ export default {
this.d_visible = newValue; this.d_visible = newValue;
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
if (this.type !== 'linear') { if (this.type !== 'linear') {
const button = DomHandler.findSingle(this.container, '[data-pc-name="button"]'); const button = DomHandler.findSingle(this.container, '[data-pc-name="button"]');
const firstItem = DomHandler.findSingle(this.list, '[data-pc-section="menuitem"]'); const firstItem = DomHandler.findSingle(this.list, '[data-pc-section="menuitem"]');

View File

@ -121,9 +121,10 @@ export default {
this.scrollInView({ index: newValue }); this.scrollInView({ index: newValue });
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
},
mounted() {
this.updateInkBar(); this.updateInkBar();
this.scrollable && this.updateButtonState(); this.scrollable && this.updateButtonState();
}, },

View File

@ -85,7 +85,7 @@ export default {
} }
} }
}, },
mounted() { beforeMount() {
this.id = this.id || UniqueComponentId(); this.id = this.id || UniqueComponentId();
}, },
beforeUnmount() { beforeUnmount() {