1.0.1 • Published 7 years ago
vue-slide-options v1.0.1
vue-slide-options
dependence: webpack, vue-loader
START UP
INSTALL
npm i vue-slide-options
BASIC USAGE
<vue-slide-options>
<div slot="cover">an item 一个列表</div>
<div slot="options">an options 一个选项</div>
</vue-slide-options>
SLOT
- cover: NEEDED
- the element seen as the cover,like the chat list in the example image
- options:
- the element hiding under the cover laying at the right side
PROPS
props | needed | type | default | description |
---|---|---|---|---|
threshold | no | Number | 0.5 | 0.5 means when touch move distance >= 0.5* options.width, when finger leave it will auto-slide to show all options, IF < ,auto-slide to hide them all |
speed | no | Number | 0.2 | 0.2 means finish auto-slide in 0.2s |
METHODS
- close
- close the opening option
<vue-slide-options ref="mySlide">
<div slot="cover">an item 一个列表</div>
<div slot="options">an options 一个选项</div>
</vue-slide-options>
<script>
// use
this.refs.mySlide.close()
</script>