master
wangxia 2 months ago
parent 9dd3e1be19
commit 219712c3e8

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

Loading…
Cancel
Save