master
wangxia 2 months ago
parent 9dd3e1be19
commit 219712c3e8

@ -27,17 +27,13 @@ export default {
},
data() {
return {
// activeIndex: this.current, // computed
// targetScrollId: `tab-${this.current}`, // scroll-into-viewid(computed)
targetScrollId: `tab-${this.current}`, // scroll-into-viewid
};
},
computed: {
activeIndex() {
return this.current;
},
targetScrollId() {
return `tab-${this.current}`;
},
},
methods: {
// tab
@ -45,7 +41,7 @@ export default {
if (this.activeIndex === index) return;
this.activeIndex = index;
this.$emit("change", index);
console.log();
// idtab
this.calcTargetScrollId(index);
},

Loading…
Cancel
Save