<!-- 在你的主页面中 -->
|
<template>
|
<div class="app-container">
|
<el-tabs v-model="activeTab"
|
@tab-change="handleTabChange">
|
<el-tab-pane label="正常供应商"
|
name="home">
|
<HomeTab ref="homeTab" />
|
</el-tab-pane>
|
<el-tab-pane label="黑名单"
|
name="blacklist">
|
<BlacklistTab ref="blacklistTab" />
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</template>
|
|
<script>
|
import HomeTab from "./components/HomeTab.vue";
|
import BlacklistTab from "./components/BlacklistTab.vue";
|
|
export default {
|
name: "MainPage",
|
components: {
|
HomeTab,
|
BlacklistTab,
|
},
|
data() {
|
return {
|
activeTab: "home",
|
};
|
},
|
methods: {
|
handleTabChange(tabName) {
|
this.activeTab = tabName;
|
this.$nextTick(() => {
|
if (tabName === "home") {
|
this.$refs.homeTab &&
|
this.$refs.homeTab.getList &&
|
this.$refs.homeTab.getList();
|
} else if (tabName === "blacklist") {
|
this.$refs.blacklistTab &&
|
this.$refs.blacklistTab.getList &&
|
this.$refs.blacklistTab.getList();
|
}
|
});
|
},
|
},
|
};
|
</script>
|