Skip to content

A button that, when you click it, brings your screen to the top

License

Notifications You must be signed in to change notification settings

Nightscratch/vue-gotop-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VUE GotopButton

安装

npm i vue-gototop-button

引入

全局引入

// main.js
import { createApp } from 'vue'
import { gtbutton } from 'vue-gototop-button'
import App from './App.vue'
// ...
createApp(App).use(gtbutton).mount('#app')

局部引入

<script setup>
import { GoTopBtn } from 'vue-gototop-button'
</script>

使用

<template>
    <GoTopBtn :top="20">
        <p></p>
    </GoTopBtn>
</template>

参数

属性名 说明
top 当屏幕滚动小于该值时显示按钮

修改 css

node_modules/vue-gototop-button/GoTopButton.css修改

默认值:

button{
    position: fixed;
    right: 50px;
    bottom: 50px;
}

About

A button that, when you click it, brings your screen to the top

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published