From f8105c2902bc5ca57c92f8f2898c62a6d5fa001e Mon Sep 17 00:00:00 2001 From: Kael Date: Tue, 20 Feb 2024 19:13:39 +1100 Subject: [PATCH] docs(goto): only call useGoTo in setup closes #19163 --- packages/docs/src/examples/scroll/usage.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/docs/src/examples/scroll/usage.vue b/packages/docs/src/examples/scroll/usage.vue index 81cd19f0fae..71cdf60a706 100644 --- a/packages/docs/src/examples/scroll/usage.vue +++ b/packages/docs/src/examples/scroll/usage.vue @@ -279,6 +279,10 @@ import { useGoTo } from 'vuetify' export default { + setup () { + const goTo = useGoTo() + return { goTo } + }, data () { return { duration: 300, @@ -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 () { @@ -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' }) }, }, }