vue-goto-top
v1.0.0
Published
This is a button component that can go back to the top of the page. It's called Vue-Goto-Top. I hope it's helpful for your development.
Downloads
7
Readme
vue-goto-top
下载
npm i vue-goto-top
使用
1. 全局使用
import GoToTop from "vue-goto-top";
Vue.component(GoToTop.name,GoToTop);
2. 局部使用
import GoToTop from "vue-goto-top";
components: {GoToTop}
Props
| 参数 | 类型 | 作用 | | ----------- | ------ | ------------------- | | top | number | 默认是600, 距离顶部多少px显示回到顶部按钮 |
例子
<template>
<div>
<GoToTop :top="600"/>
</div>
<template/>
<script>
import GoToTop from "vue-goto-top";
export default {
name: "GoToTop",
components: {GoToTop},
data() {
return {
}
},
}
</script>