elementui 中tab切换
<el-tabs v-model="activeName" @tab-click="handleClick"><el-tab-pane label="工业用户" name="0"><Industrial v-if="activeName == 0" :gas-type="3"></Industrial></el-tab-pane><
·
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="工业用户" name="0">
<Industrial v-if="activeName == 0" :gas-type="3"></Industrial>
</el-tab-pane>
<el-tab-pane label="商业用户" name="1">
<Commerce v-if="activeName == 1"></Commerce>
</el-tab-pane>
<el-tab-pane label="民用用户" name="2">
<Civil v-if="activeName == 2"></Civil>
</el-tab-pane>
<el-tab-pane label="煤改气用户" name="3">
<Gas v-if="activeName == 3"></Gas>
</el-tab-pane>
</el-tabs>
export default {
components: { Civil, Commerce, Industrial, Gas },
data() {
return {
activeName: '0'
}
},
methods: {
handleClick(tab) {
this.activeName = tab.index
}
}
}
</script>
更多推荐
已为社区贡献1条内容
所有评论(0)