https://github.com/zgldh/scroll-to-top
A scroll page/container to top button made with Vue2
https://github.com/zgldh/scroll-to-top
Last synced: about 1 month ago
JSON representation
A scroll page/container to top button made with Vue2
- Host: GitHub
- URL: https://github.com/zgldh/scroll-to-top
- Owner: zgldh
- License: isc
- Created: 2018-06-19T08:05:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-21T08:30:05.000Z (almost 8 years ago)
- Last Synced: 2025-05-23T04:50:00.323Z (about 1 year ago)
- Language: Vue
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scroll-to-top
A scroll page/container to top button made with Vue2
一个点一下就能自动滚动到顶的小按钮。
## 使用
```
npm i vue-scroll-to-top
```
在 Vue 页面里
```
import ScrollToTop from 'vue-scroll-to-top'
components: { ScrollToTop },
```
## 参数
1. scrollBox: // 滚动条所在的DOM对象或其选择器
type: [String, Object],
required: false,
default: '.app-main'
2. animationTime: // 滚动到顶部的动画时间,单位为毫秒,100 到 200 之间。默认值为 150
type: Number,
required: false,
default: 150
3. right: // 距离右边多远
type: String,
required: false,
default: "100px"
4. bottom: // 距离下边多远
type: String,
required: false,
default: "100px"