<template>
<div>
<div>
<el-button type="primary" size="mini" @click="toggleView('tabOne')">tab1按钮</el-button>
<el-button type="primary" size="mini" @click="toggleView('tabTwo')">tab2按钮</el-button>
</div>
<component :is="view"></component>
</div>
</template>
<script>
import tabOne from "../components/tabOne";
import tabTwo from "../components/tabTwo";
export default {
components: {
tabOne,
tabTwo
},
data() {
return {
view: "tabOne"
};
},
methods: {
toggleView(val) {
this.view = val;
}
}
};
</script>
<style lang="scss" scoped></style>