1.0.0 • Published 3 years ago
vue-goto-top v1.0.0
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>
1.0.0
3 years ago