界面部分代码
<el-tabs v-model="activeName" @tab-click="handleClick" >
<el-tab-pane label="基本信息" name="first">
<!-- 表单内容-->
<div v-if="isFirst">
<el-form ref="form" :model="formTable" :rules="rule" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="意向部门" prop="dept" >
<dept-select v-model="formTable.dept"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
js部分代码
handleClick(tab) {
if (tab.name === 'first') {
this.isFirst = true
this.isSecond = false
this.isThird = false
this.isFourth = false
} else if (tab.name === 'second') {
this.isFirst = false
this.isSecond = true
this.isThird = false
this.isFourth = false
}
else if (tab.name === 'third') {
this.isFirst = false
this.isSecond = false
this.isThird = true
this.isFourth = false
} else if (tab.name === 'fourth') {
this.isFirst = false
this.isSecond = false
this.isThird = false
this.isFourth = true
}
}