Skip to content

Commit

Permalink
docs(goto): only call useGoTo in setup
Browse files Browse the repository at this point in the history
closes #19163
  • Loading branch information
KaelWD committed Feb 20, 2024
1 parent 07d91b2 commit f8105c2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/docs/src/examples/scroll/usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@
import { useGoTo } from 'vuetify'
export default {
setup () {
const goTo = useGoTo()
return { goTo }
},
data () {
return {
duration: 300,
Expand Down Expand Up @@ -340,13 +344,12 @@
},
methods: {
onClick () {
const goTo = useGoTo()
if (this.target === 'By Number') {
goTo(this.number, this.options)
this.goTo(this.number, this.options)
} else if (this.target === 'By Query Selector') {
goTo(this.query, this.options)
this.goTo(this.query, this.options)
} else if (this.target === 'By Component / Element') {
goTo(this.cards[this.component].$el, this.options)
this.goTo(this.cards[this.component].$el, this.options)
}
},
onClickReset () {
Expand All @@ -358,8 +361,7 @@
this.query = '#heading-3'
this.target = 'By Number'
const goTo = useGoTo()
goTo(0, { container: '#goto-container-example' })
this.goTo(0, { container: '#goto-container-example' })
},
},
}
Expand Down

0 comments on commit f8105c2

Please sign in to comment.