vue-antiscroll-addon
v2.1.4
Published
A Vue Antiscroll addon
Downloads
1
Readme
Vue-Antiscroll-Addon
Features
- package the antiscroll use vue component
- enhance it with css-element-queries
- perfectly unified native scroll bar
Support
Support Vue.js 2.0+
Install
npm install vue-antiscroll-addon
Useage
// in entry file
import Vue from 'vue'
import vueAntiscroll from 'vue-antiscroll-addon'
Vue.component('vueAntiscroll', vueAntiscroll)
Example
<VueAntiscroll class="el-menu__wrapper width-100" :height="menuBoxHeight">
// content
</VueAntiscroll>
Props
| Name | Type | Description | Optional value | Default | | ------------- |-------| -----| ----| -------| | height |int|the container height| —|—| | width |int|the container width| —|—| | scrolling |function|on scroll callback —|—| | scrollToBottom |function|on scrollToBottom called up| —|—| | initialDisplay |boolean|Whether to display when initialized scrollbar| —|—| | barClass |string|auto add when initialized scrollbar| —|—| | transitionTarget |string|css selector(When your scroll toggle display in an transition element, you may provide transitionTarget, then the scroll will auto refresh() after transitionend event )| eg: '.abc'|—|
Api
- scrollTo
<VueAntiscroll ref="antiscroll" class="el-menu__wrapper width-100" :height="menuBoxHeight">
// content
</VueAntiscroll>
// paramter
// bottom, top, left, right
this.$refs.antiscroll.scrollTo('bottom')
- refresh
<VueAntiscroll ref="antiscroll" class="el-menu__wrapper width-100" :height="menuBoxHeight">
// content
</VueAntiscroll>
//You may need it when the display is switched
this.$refs.antiscroll.refresh()
Compatibility
PC: IE9+
LICENSE
MIT