<template>
<el-tabs v-model="activeName" style="padding-left: 5px;" @tab-click="handleClick">
<el-tab-pane label="针卡列表" name="first">
<unlock v-if="isUnlock"/>
</el-tab-pane>
<el-tab-pane label="废止针卡列表" name="second">
<lock v-if="isLock"/>
</el-tab-pane>
</el-tabs>
</template>
<script>
import Lock from './lock'
import Unlock from './unlock'
export default {
components: { Lock, Unlock },
data() {
return {
activeName: 'first',
isUnlock: true,
isLock: false
}
},
methods: {
handleClick(tab) {
if (tab.name === 'first') {
this.isUnlock = true
this.isLock = false
} else if (tab.name === 'second') {
this.isUnlock = false
this.isLock = true
}
}
}
}
</script>
<style scoped>
</style>
每一个tab切换的都是一个新的组件刷新
最新推荐文章于 2024-02-04 10:40:12 发布