Get from npm / yarn:
npm i vue-scroll-up@1.1.0
yarn add vue-scroll-up@1.1.0
or just include vue-scroll-up.js to your view like
<script src='./vue-scroll-up.js'></script>
Use this inside your app:
import ScrollUp from 'vue-scroll-up'
export default {
name: 'app',
components: {
ScrollUp,
}
}
import 'vue-scroll-up/dist/style.css'
or just include style.css
The scroll button class name is vue-scroll-up
<scroll-up :scroll-duration="1000" :scroll-y="250"></scroll-up>
Property | Type | Default Value | Description |
---|---|---|---|
scroll-duration | Number | 1000 | Page to top speed. |
scroll-y | Number | 250 | Show button when scrollY equals a number. |