tab

    <Tabs :value="currentTab" @on-click="changeTab" style="background-color: white" v-if="menuList.length">
      <TabPane v-for="(item, index) in menuList" :key="index" :label="item.name" :name="item.routeName"></TabPane>
    </Tabs>
 <component :is="currentView" v-if="currentView"></component>
 
import Activity from './activity-conf.vue';
import Target from './target-configuration/index.vue';
export default {
	components: { Activity, Target },

	data() {
		return {
	      	menuList: [
        	{
          		name: '目标配置', // 目标配置
          		routeName: 'passenger-flow-target',
          		accessKey: 'CUSTOMER_TARGET_CONFIGURATION',
       		},
        	{
          		name: '活动配置', // 活动配置
          		routeName: 'passenger-flow-event',
          		accessKey: 'CUSTOMER_EVENT_CONFIGURATION',
        	},
      	],
      	currentView: '',
      	currentTab: '',
		}
	}
	created(){
		this.menuList[0] && this.changeTab(this.menuList[0].routeName);
	}
	methods:{
    	changeTab(item) {
      		this.currentTab = item;
      		switch (item) {
        		case 'passenger-flow-target':
          			this.currentView = 'Target';
          			break;
        		case 'passenger-flow-event':
          			this.currentView = 'Activity';
          			break;
      			}
    		},
		}
	}
上一篇:使用 Javascript 与 Flow 交互


下一篇:Git Flow 的正确使用姿势