From e99174b57620c451ce5b20b1bdc5c66b95514560 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 13 May 2024 15:20:44 +0300 Subject: [PATCH] TabMenu: initial inkbar fixes --- components/lib/tabmenu/TabMenu.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/lib/tabmenu/TabMenu.vue b/components/lib/tabmenu/TabMenu.vue index 2933bb62d..ac682dd82 100755 --- a/components/lib/tabmenu/TabMenu.vue +++ b/components/lib/tabmenu/TabMenu.vue @@ -39,29 +39,29 @@ export default { extends: BaseTabMenu, inheritAttrs: false, emits: ['update:activeIndex', 'tab-change'], - timeout: null, data() { return { d_activeIndex: this.activeIndex }; }, watch: { - activeIndex(newValue) { - this.d_activeIndex = newValue; + activeIndex: { + flush: 'post', + handler(newValue) { + this.d_activeIndex = newValue; + this.updateInkBar(); + } } }, mounted() { - this.updateInkBar(); + this.$nextTick(() => { + this.updateInkBar(); + }); + const activeItem = this.findActiveItem(); activeItem && (activeItem.tabIndex = '0'); }, - updated() { - this.updateInkBar(); - }, - beforeUnmount() { - clearTimeout(this.timeout); - }, methods: { getPTOptions(key, item, index) { return this.ptm(key, {