0.1.0 • Published 4 years ago

vue-slim-scrolltop v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

vue-slim-scrolltop

A Simple ScrollTop Button Component for Vue.js, that scroll page to top when clicked.

Features

  • Make Floating ScrollTop Button Component on your project

Installing

$ npm install vue-slim-scrolltop

Usage

  • Default Usage :
<template>
  <div>
    <scroll-top />
  </div>
</template>

<script>
import ScrollTop from 'vue-slim-scrolltop';

export default {
  components: {
    ScrollTop,
  },
};
</script>
  • If you wanna use custom settings, then :
<template>
  <div>
    <scroll-top
    :locationX="locationX"
    :locationY="locationY"
    :dataX="dataX"
    :dataY="dataY"
    :text="text" />
  </div>
</template>

<script>
import ScrollTop from 'vue-slim-scrolltop';

export default {
  components: {
    ScrollTop,
  },
  data() {
    return {
      locationX: 'left',
      locationY: 'bottom',
      dataX: 10,
      dataY: 10,
      text: 'Scroll to Top (Custom Text)',
    };
  },
};
</script>

Props

NameTypeDefaultDescription
locationXString'right'X-Axis Type of position, like 'left', 'right'.
locationYString'bottom'Y-Axis Type of position, like 'top', 'bottom'.
dataXString or Number80X-Axis value of position
dataYString or Number80Y-Axis value of position
textString'Scroll Page to Top'Text of button

Author

vue-slim-scrolltop © CHE5YA, Released under the MIT License.

GitHub @che5ya · Facebook @che5ya · Twitch @chesya_

License

MIT