1.0.17 • Published 6 years ago
vue2-iscroll v1.0.17
Install
$ npm i vue2-iscroll
Get Start
import Scroll from 'vue2-iscroll'
Vue.use(Scroll)
Usage
Set IScroll options
需要传递的参数:cur-index,如果不传则默认为0,滑动到相应的分页snap
简单的tab页签是纯文本的,建议使用span,display: inline-block;
复杂的tab页签建议使用li(如下代码所示),不建议使用div
<iscroll :cur-index="curIndex">
<li class="list"
:class="{'active':curIndex==index}"
v-for="(list,index) in lists"
@click="change(list-1)">
<img src="list.image" alt="" width="100" height="100">
<span>{{index}}</span>
</li>
</iscroll>