A Vue.js components to scroll to top
$ npm install vue-backtop-pack
import Vue from 'vue'
import vueBacktopPack from 'vue-backtop-pack'
Vue.use(vueBacktopPack)
or
<script src="vue.min.js"></script>
<!-- must place this line after vue.js -->
<script src="vue-backtop-pack.umd.min.js"></script>
<!-- default -->
<vue-backTop></vue-backTop>
<vue-backTop :height="600" :bottom="50" :right="30" @onClick="handleOnClick" @complete="handleComplete">
<span>scrollTop</span>
</vue-backTop>
Property | Description | Type | Default |
---|---|---|---|
height | visible height | Number | 400 |
bottom | distance to the bottom | Number | 30 |
right | distance to the right | Number | 30 |
duration | animation time | Number | 1000 |
Name | Description |
---|---|
onClick | when click |
complete | when scroll to top complete |