前端:
<div>
<el-radio-group class="tabs" size="small" v-model="tabsIndex" style="margin: 17px">
<el-radio-button class="test-radio" label="user">
用户信息
</el-radio-button>
<el-radio-button class="test-radio" label="order">
订单管理
</el-radio-button>
<el-radio-button class="test-radio" label="equipment">
设备管理
</el-radio-button>
</el-radio-group>
<div class="main">
<user v-if="tabsIndex == 'user'" />
<order v-if="tabsIndex == 'order'" />
<equipment v-if="tabsIndex == 'equipment'" />
</div>
</div>
js:
//引用(import)时
1、../ 表示本目录的上级
2、./表示本目录的同级
import user from "./user";
import order from "./order";
import equipment from "./equipment";
export default {
components:{user,order,equipment},
data() {
return {
tabsIndex: 'user'
}
}
}