Skip to content

Commit

Permalink
feat(goTo): port to v3 (#19046)
Browse files Browse the repository at this point in the history
closes #5732
closes #13538

Co-authored-by: Yuchao <[email protected]>
  • Loading branch information
johnleider and yuwu9145 authored Jan 19, 2024
1 parent 7031faa commit 4eeae8c
Show file tree
Hide file tree
Showing 12 changed files with 679 additions and 162 deletions.
6 changes: 6 additions & 0 deletions packages/api-generator/src/locale/en/useGoTo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"exposed": {
"rtl": "The current RTL state.",
"options": "The current goTo scrolling options."
}
}
19 changes: 9 additions & 10 deletions packages/docs/src/components/app/BackToTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,27 @@
elevation="8"
icon="mdi-chevron-up"
size="large"
@click="onClick"
@click="goTo(0)"
/>
</v-fab-transition>
</div>
</v-layout-item>
</template>

<script setup>
import { ref } from 'vue'
// Composables
import { useGoTo } from 'vuetify'
const model = ref(false)
// Utilities
import { shallowRef } from 'vue'
const goTo = useGoTo({ layout: true })
const model = shallowRef(false)
function onScroll () {
model.value = window.scrollY > 200
}
function onClick () {
window.scrollTo({
top: 0,
behavior: 'smooth',
})
}
</script>

<style scoped>
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/data/nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"global-configuration",
"icon-fonts",
"internationalization",
"scrolling",
"sass-variables",
"theme",
"treeshaking"
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/data/page-to-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@
"directives/touch": ["v-touch"],
"features/dates": ["useDate"],
"features/display-and-platform": ["useDisplay"],
"features/scrolling": ["useGoTo"],
"features/global-configuration": ["VDefaultsProvider"],
"features/internationalization": ["useLocale", "VLocaleProvider"],
"features/scrolling": ["$vuetify"],
"features/theme": ["VThemeProvider"],
"styles/transitions": [
"VDialogBottomTransition",
Expand Down
Loading

0 comments on commit 4eeae8c

Please sign in to comment.