vue-position-sticky-b
vue-position-sticky
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
| Property | Description | Type | Default |
|---|---|---|---|
| offsetTop | distance to the top | Number | 0 |
| offsetBottom | distance to the bottom | Number | undefined |
| stickyClass | vue-position-sticky component class | String | '' |
Callback
| Name | Description |
|---|---|
| change | when sticky will emit |
Related Packages
vue-affix
A Vue.js plugin that affixes an element in the window while you scroll, similar...
153,389
405
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.3 | ^2.5.16 | ||
| 0.2.2 | ^2.5.16 | ISC |