1.0.1 • Published 6 years ago

vue-top v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

vue-top

A simple Vue.js component to scroll your webpage to the top

Installation

npm install --save vue-top

Use with Single File Component

Globally

import VueTop from 'vue-top';

Vue.component('vue-top', VueTop);

Locally

import VueTop from 'vue-top';

export default {
  components: {
    ... ,
    VueTop,
  },
};

Use in Browser

Include js file in page

<script type="text/javascript" src="unpkg.com/vue-top@1.0.0/dist/vue-top.min.js"></script>

Install as plugin

Vue.use(VueTop);

Usage

<vue-top>
  <!-- Your HTML CODE -->
</vue-top>

Example

<vue-top>
  <i class="fa fa-arrow-up" aria-hidden="true"></i>
</vue-top>
<vue-top>
  <img src="path/yourIcon.png"></img>
</vue-top>

Properties

OptionTypeDefaultDescription
bottomString30pxThis property will convert to CSS style property which is the distance from bottom of browser edge
rightString30pxThis property will convert to CSS style property which is the distance from right of browser edge
speedNumber500Scolling speed , the smaller the faster
customStyleObjectNullDefine your own style to the component