Hello. I'm creating a "go to the top of the page" button using vuetify. I can already make it go to the top with the following code:
@click="$vuetify.goTo(0,0)
But now I would like it to only appear if I scroll the page down a little.
I tried this:
data() {
topo: 0
}
methods: {
sumir(){
this.topo = window.pageYOffset || document.documentElement.scrollTop
}
}
Then I made the button:
:v-show ="topo > 100" ou v-show ="topo > 100"
both to no avail. Could someone help?