<!-- 在你的主页面中 -->
|
<template>
|
<div class="app-container">
|
<el-tabs v-model="activeTab" type="card">
|
<el-tab-pane label="正常供应商" name="home">
|
<HomeTab />
|
</el-tab-pane>
|
<el-tab-pane label="黑名单" name="blacklist">
|
<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'
|
}
|
},
|
watch: {
|
activeTab(newVal) {
|
if (newVal === 'home') {
|
this.$refs.homeTab && this.$refs.homeTab.getList()
|
} else if (newVal === 'blacklist') {
|
this.$refs.blacklistTab && this.$refs.blacklistTab.getList()
|
}
|
}
|
}
|
}
|
</script>
|
<style>
|
.main-container :deep(.el-tabs__item.is-active) {
|
color: #1883f6 !important;
|
border-bottom: 2px solid #409EFF;
|
}
|
|
</style>
|