2.0.0 • Published 2 months ago

@inotom/vue-go-top v2.0.0

Weekly downloads
457
License
MIT
Repository
github
Last release
2 months ago

vue-go-top

Scroll to page top button, Vue.js component.

From v2.0.0, it works for Vue 3.

Demo

Demo

Install

Browser

<script src="vue.global.prod.js"></script>
<script src="https://unpkg.com/throttle-debounce@5/umd/index.js"></script>
<script src="https://unpkg.com/sweet-scroll/sweet-scroll.min.js"></script>
<script src="vue-go-top.umd.js"></script>

npm

npm install --save @inotom/vue-go-top

Usage

Browser

<div id="app">
  <go-top></go-top>
</div>

<script src="vue.global.prod.js"></script>
<script src="https://unpkg.com/throttle-debounce@5/umd/index.js"></script>
<script src="https://unpkg.com/sweet-scroll/sweet-scroll.min.js"></script>
<script src="vue-go-top.umd.js"></script>
<script>
const { createApp } = Vue;
const { GoTop } = SwsVueGoTop;

createApp({
  components: {
    GoTop,
  },
}).mount('#app');
</script>

SFC (TypeScript)

<template>
  <go-top></go-top>
</template>

<script setup lang="ts">
import { GoTop } from '@inotom/vue-go-top';
</script>

Props

nametypedefaultsdescription
:sizeNumber70width/height pixel size
:rightString, Number50margin from right
:bottomString, Number100margin from bottom
:bottom-gapString, Number0gap of bottom margin
:z-indexNumber1000z-index size
fg-colorString#fffffftext color
bg-colorString#ffc966background color
:radiusString, Number50%border-radius size
weightStringnormalline weight of arrow
ripple-bgStringrgba(255, 255, 255, .5)ripple animation color
:boundaryNumber200top position where the element is displayed
:max-widthNumber640media query max-width(px)
srcStringnullimage url
altString | alternative text for image
:has-outlineBooleantrueshow outline when focus
box-shadowString1px 1px 2px rgba(0, 0, 0, .3)box-shadow property
:tabindexNumber0tabindex property

License

MIT

Author

inotom

2.0.0

2 months ago

2.0.0-beta.1

3 months ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago