refactor: #7090 for TreeSelect

pull/7064/merge
Mert Sincan 2025-01-14 11:13:50 +00:00
parent f36d6c0285
commit bb57b0ae23
1 changed files with 2 additions and 7 deletions

View File

@ -132,7 +132,7 @@
import { absolutePosition, addStyle, find, findSingle, focus, getFirstFocusableElement, getFocusableElements, getLastFocusableElement, getOuterWidth, isTouchDevice, relativePosition } from '@primeuix/utils/dom';
import { isEmpty, isNotEmpty } from '@primeuix/utils/object';
import { ZIndex } from '@primeuix/utils/zindex';
import { ConnectedOverlayScrollHandler, UniqueComponentId } from '@primevue/core/utils';
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
import ChevronDownIcon from '@primevue/icons/chevrondown';
import TimesIcon from '@primevue/icons/times';
import Chip from 'primevue/chip';
@ -152,16 +152,12 @@ export default {
},
data() {
return {
id: this.$attrs.id,
focused: false,
overlayVisible: false,
d_expandedKeys: this.expandedKeys || {}
};
},
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
},
modelValue: {
handler: function () {
if (!this.selfChange) {
@ -200,7 +196,6 @@ export default {
}
},
mounted() {
this.id = this.id || UniqueComponentId();
this.updateTreeState();
},
methods: {
@ -560,7 +555,7 @@ export default {
return !this.options || this.options.length === 0;
},
listId() {
return this.id + '_list';
return this.$id + '_list';
},
hasFluid() {
return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid;