interaction between texts and toc, alpha version, still buged

This commit is contained in:
2020-07-13 12:46:47 +02:00
parent d336347fcb
commit 64f38eac6f
9 changed files with 153 additions and 29 deletions
+20 -1
View File
@@ -7,7 +7,7 @@
<slot name="header" />
</header>
<section class="col-6">
<section ref="scrollablecenter" class="col-6" @scroll.passive="onScrollCenter">
<slot />
</section>
@@ -25,6 +25,25 @@ export default {
id: {
type: String,
required: true
},
reftoscrollto: { type: String }
},
watch: {
reftoscrollto: function (newref, oldref) {
console.log('reftoscrollto watcher', oldref, newref)
this.scrollToRef()
}
},
methods: {
onScrollCenter (e) {
// console.log('mainLayout onScrollCenter: e', e)
this.$emit('onCenterScrolled', e)
},
scrollToRef () {
console.log('scrollToRef', this.reftoscrollto, this.$refs)
this.$scrollTo(this.reftoscrollto, 500, {
container: this.$refs.scrollablecenter
})
}
}
}