refactor: #7090 for ScrollPanel

pull/7064/merge
Mert Sincan 2025-01-14 11:12:50 +00:00
parent ba5cad39f5
commit dad72dfc82
1 changed files with 1 additions and 10 deletions

View File

@ -41,7 +41,6 @@
<script> <script>
import { addClass, getHeight, removeClass } from '@primeuix/utils/dom'; import { addClass, getHeight, removeClass } from '@primeuix/utils/dom';
import { UniqueComponentId } from '@primevue/core/utils';
import BaseScrollPanel from './BaseScrollPanel.vue'; import BaseScrollPanel from './BaseScrollPanel.vue';
export default { export default {
@ -63,20 +62,12 @@ export default {
outsideClickListener: null, outsideClickListener: null,
data() { data() {
return { return {
id: this.$attrs.id,
orientation: 'vertical', orientation: 'vertical',
lastScrollTop: 0, lastScrollTop: 0,
lastScrollLeft: 0 lastScrollLeft: 0
}; };
}, },
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
}
},
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.$el.offsetParent) { if (this.$el.offsetParent) {
this.initialize(); this.initialize();
} }
@ -378,7 +369,7 @@ export default {
}, },
computed: { computed: {
contentId() { contentId() {
return this.id + '_content'; return this.$id + '_content';
} }
} }
}; };