vue-scroll-up
Version:
A Vue.js component to top of the page
56 lines (43 loc) • 1.48 kB
Markdown
# vue-scroll-up
[](https://vuejs.org/) [](https://www.npmjs.com/package/vue-scroll-up) [](https://www.npmjs.com/package/vue-scroll-up) [](https://github.com/runkids/Vue-Scroll-Up/blob/master/LICENSE)
<img src="https://i.imgur.com/OOlKiny.gif"/>
## Installation
Get from npm / yarn:
```js
npm i vue-scroll-up
```
```js
yarn add vue-scroll-up
```
or
just include [vue-scroll-up.js](https://github.com/runkids/Vue-Scroll-Up/blob/master/dist/vue-scroll-up.js) to your view like
```js
<script src='./vue-scroll-up.js'></script>
```
## Usage
Use this inside your app:
``` js
import ScrollUp from 'vue-scroll-up'
export default {
name: 'app',
components: {
ScrollUp,
}
}
```
##### With Default CSS
```js
import 'vue-scroll-up/dist/style.css'
```
or
just include [style.css](https://github.com/runkids/Vue-Scroll-Up/blob/master/dist/style.css)
The scroll button class name is `vue-scroll-up`
##### HTML
```html
<scroll-up :scroll-duration="1000" :scroll-y="250"></scroll-up>
```
## Props
| Property | Type | Default Value | Description |
| ------------ | ------------ | ------------ | ------------ |
|scroll-duration | Number | 1000 | Page to top speed.|
| scroll-y | Number | 250 | Show button when scrollY equals a number.|