TabMenu: initial inkbar fixes

pull/5756/head
tugcekucukoglu 2024-05-13 15:20:44 +03:00
parent 51df79c306
commit e99174b576
1 changed files with 10 additions and 10 deletions

View File

@ -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) {
activeIndex: {
flush: 'post',
handler(newValue) {
this.d_activeIndex = newValue;
this.updateInkBar();
}
}
},
mounted() {
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, {