Blame view
src/components/AppFab.vue
670 Bytes
04e3fbc56
|
1 |
<template> |
93a68cfa1
|
2 |
<v-fab-transition> |
4413a8d93
|
3 |
<v-btn fab="fab" small dark="dark" fixed="fixed" bottom="bottom" right="right" color="green" v-scroll="onScroll" v-show="fab" @click="toTop"> |
93a68cfa1
|
4 5 6 |
<v-icon>keyboard_arrow_up</v-icon> </v-btn> </v-fab-transition> |
04e3fbc56
|
7 |
</template> |
93a68cfa1
|
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<script> export default { name: 'app-fab', data: () => ({ fab: false }), methods: { onScroll () { if (typeof window === 'undefined') return; const top = window.pageYOffset || document.documentElement.offsetTop || 0; this.fab = top > 300; }, toTop () { this.$router.push({ hash: '' }); this.$vuetify.goTo(0); } } }; </script> |