Laterally slidable vue tab assembly

Examples


Front-end technology: frame -> vue
Components> ly-tab for a mobile terminal having a touch slide spring back effect may reusable assembly Vue
address ly-tab describes
ly-tab npm address

Steps for usage

1, the introduction of the package, defined as common components

Code

import LyTab from '../packages/tab'
Vue.use(LyTab)

2, page calls, define the data source, write event


Code

//调用
  <ly-tab
                    v-model="selectedId"
                    :items="policyListArr"
                    :options="options"
                    @change="handleChange" >
                </ly-tab>
//数据源
data(){
return{
    selectedId:1,
                options: {
                    activeColor: '#4e95f7'
                },
                backgroundstyle:'rgba(255, 255, 255, 0)',
                colorstyle:'rgba(255,255,255, 1)',
                policyListArr: [
                    {
                        label: '全部',
                        categoryId: -1,
                        lastId: 0,
                        list: [],
                    },
                ], // 列表数据
}
}
            
//事件
    handleChange (itemObj,i) {
                this.selectedId=i
                const item = this.policyListArr[i]
                item.list = []
                item.lastId = 0
                this.active = i
                this.isLoadedAll = false
                this.isLoadingNo = false
                this.isLoadingMore = false
                this.scroller.openPullUp()
                this.searchList(i)
            },

What specific changes would also change according to their own business

Guess you like

Origin www.cnblogs.com/lml-lml/p/10954069.html