Skip to content

Commit

Permalink
Refactor #4953 - For TreeSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Feb 2, 2024
1 parent 784f7d9 commit 0575260
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/lib/treeselect/TreeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,16 @@ export default {
emits: ['update:modelValue', 'before-show', 'before-hide', 'change', 'show', 'hide', 'node-select', 'node-unselect', 'node-expand', 'node-collapse', 'focus', 'blur'],
data() {
return {
id: this.$attrs.id,
focused: false,
overlayVisible: false,
expandedKeys: {}
};
},
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
},
modelValue: {
handler: function () {
if (!this.selfChange) {
Expand Down Expand Up @@ -161,6 +165,7 @@ export default {
}
},
mounted() {
this.id = this.id || UniqueComponentId();
this.updateTreeState();
},
methods: {
Expand Down Expand Up @@ -487,7 +492,7 @@ export default {
return !this.options || this.options.length === 0;
},
listId() {
return UniqueComponentId() + '_list';
return this.id + '_list';
}
},
components: {
Expand Down

0 comments on commit 0575260

Please sign in to comment.