0.2.1 • Published 4 years ago

vue-position-sticky v0.2.1

Weekly downloads
198
License
-
Repository
github
Last release
4 years ago

vue-position-sticky

image image

A Vue.js component to sticky to the page

Install

$ npm install vue-position-sticky

Usage

import Vue from 'vue'
import vuePositionSticky from 'vue-position-sticky'

Vue.use(vuePositionSticky)

or

<script src="vue.min.js"></script>
<!-- must place this line after vue.js -->
<script src="vue-position-sticky.umd.min.js"></script>

Demo

<vue-position-sticky :offsetTop="0" sticky-class="myClass" />

<vue-position-sticky :offsetBottom="30" @change="handleStickyChange" />

<vue-position-sticky>
    <span>sticky slot<span>
</vue-position-sticky>

Options

PropertyDescriptionTypeDefault
offsetTopdistance to the topNumber0
offsetBottomdistance to the bottomNumberundefined
stickyClassvue-position-sticky component classString''

Callback

NameDescription
changewhen sticky will emit