标签:index 控制器 use target 技术 code alt scroll export
npm i vue-cus-tabs -S
import ‘vue-cus-tabs/style/index.css‘ import { installCusTabs } from ‘vue-cus-tabs‘; Vue.use(installCusTabs);
<CusTabWrap> <template v-slot:tabBar> <CusTabBar :style="{‘height‘:‘50px‘}"> <CusTabItem v-for="item in tabItems" :key="item.title"> {{item.title}} </CusTabItem> </CusTabBar> </template> <template v-slot:tabContainer> <CusTabContainer> <CusTabContainerItem v-for="item in tabItems"> <ul> <li v-for="data in item.data"> {{data.title}} </li> </ul> </CusTabContainerItem> </CusTabContainer> </template> </CusTabWrap>
import { TabController } from ‘vue-cus-tabs‘; import Vue from ‘vue‘ export default class Test extends Vue{ public tabItems = [ { title: ‘新闻‘, type: ‘list‘, data: [{ img: ‘‘, title: ‘list item title‘ }] }, { title: ‘视频‘, type: ‘block‘, data: [{ video: ‘‘, title: ‘list item title‘ }] }, { title: ‘视频1‘, type: ‘block‘, data: [{ video: ‘‘, title: ‘list item title‘ }] }, ]; public tabController?: TabController; public mounted() { // 创建控制器 this.tabController = new TabController({ data: this.tabItems, tabScroll: true, initIndex: 1 }); } }
标签:index 控制器 use target 技术 code alt scroll export
原文地址:https://www.cnblogs.com/axel10/p/11731545.html