vue+element tabs選項(xiàng)卡分頁(yè)效果
本文實(shí)例為大家分享了vue+element tabs選項(xiàng)卡分頁(yè)效果的具體代碼,供大家參考,具體內(nèi)容如下
文件目錄:
功能展示:
路由配置:
{ path: '/account', component: ()=> import('../components/home/home.vue'), //布局頁(yè)面 redirect: '/account/all-account/list', //定向到list路徑 name: '賬號(hào)管理', children: [ { path: '/account/all-account/list', redirect: '/account/all-account/staff', //定向到staff路徑 name: '員工管理', component: () => import('../components/view/account/index.vue'), children: [ { path: '/account/all-account/staff', component: () => import('../components/view/account/account.vue'), hidden: true }, { path: '/account/all-account/agent', name: '代理人賬號(hào)', component: () => import('../components/view/account/agent.vue'), hidden: true }, { path: '/account/all-account/department', name: '部門設(shè)置', component: () => import('../components/view/account/department.vue'), hidden: true }, { path: '/account/all-account/role', name: '角色權(quán)限設(shè)置', component: () => import('../components/view/account/role.vue'), hidden: true }, { path: '/account/all-account/city', name: '城市管理', component: () => import('../components/view/account/city.vue'), hidden: true }, ] }, }
組件代碼:
index.vue
<template> <div class="page_container" style="overflow:auto;height:100%;background: #ffffff;padding: 10px;min-width:1200px;"> <router-view /> </div> </template>
account.vue
<template> <!-- 賬號(hào)管理tab分頁(yè) --> <div id="employeeCareMng" class="page_container" style="overflow:auto;height:100%;background: #ffffff;min-width:1200px;"> <div v-if="isNative" > <div style="height:100%;"> <el-tabs v-model="activeName" style="height:100%;" @tab-click="handleClick"> <el-tab-pane label="員工賬號(hào)" name="first" style="height:100%;"> <staff/> </el-tab-pane> <el-tab-pane label="代理人賬號(hào)" name="second" style="height:100%;"> <agent/> </el-tab-pane> <el-tab-pane label="部門設(shè)置" name="third" style="height:100%;"> <department/> </el-tab-pane> <el-tab-pane label="角色權(quán)限設(shè)置" name="fourth" style="height:100%;"> <role/> </el-tab-pane> <el-tab-pane label="城市管理" name="fifth" style="height:100%;"> <city/> </el-tab-pane> </el-tabs> </div> </div> <div v-else style="height:100%;"> <router-view /> </div> </div> </template> <script> import staff from './staff' import agent from './agent' import department from './department' import role from './role' import city from './city' export default { components: { staff,agent,department,role,city }, data() { return { isNative: true, activeName: 'first' //默認(rèn)先渲染第一個(gè) } }, //頁(yè)面初始默認(rèn)是第一個(gè)板塊展示 created() { if (this.$route.path === '/account/all-account/staff') { this.isNative = true } else { this.isNative = false } }, methods: { handleClick(tab, event) { console.log(tab, event) } } } </script> <style scoped> .page_container{ background: #ffffff; height: 100%; } </style> <style > #employeeCareMng .el-tabs__content { height:calc(100% - 55px); } </style>
其他tabs分頁(yè)的組件:
staff.vue 其他類似
<template> <div class="staff"> 員工賬號(hào) </div> </template> <script> export default { name:"staff", data(){ return { } }, created(){ }, methods: { }, }; </script> <style scoped>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- vue3+element?Plus使用el-tabs標(biāo)簽頁(yè)解決頁(yè)面刷新不回到默認(rèn)頁(yè)的問(wèn)題
- Element--el-tabs固定在頂部問(wèn)題
- vue2項(xiàng)目使用element-ui的el-tabs組件導(dǎo)致瀏覽器崩潰卡死問(wèn)題
- elementUI給el-tabs/el-tab-pane添加圖標(biāo)效果實(shí)例
- vue?elementUi中的tabs標(biāo)簽頁(yè)使用教程
- elementui中使用el-tabs切換實(shí)時(shí)更新數(shù)據(jù)
- ElementUI中el-tabs事件綁定的具體使用
- Element中el-tabs左右滑動(dòng)動(dòng)畫的實(shí)現(xiàn)
相關(guān)文章
Vue如何動(dòng)態(tài)修改el-table的某列數(shù)據(jù)
這篇文章主要介紹了Vue如何動(dòng)態(tài)修改el-table的某列數(shù)據(jù),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-04-04vue3中addRoute路由變化頁(yè)面未刷新問(wèn)題解決
這篇文章主要為大家介紹了vue3中addRoute路由變化但頁(yè)面未刷新問(wèn)題解決,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-06-06vue3.0 vue.config.js 配置基礎(chǔ)的路徑問(wèn)題
這篇文章主要介紹了vue3.0 vue.config.js 配置基礎(chǔ)的路徑問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-10-10基于vue-cli3和element實(shí)現(xiàn)登陸頁(yè)面
這篇文章主要介紹了vue-cli3和element做一個(gè)簡(jiǎn)單的登陸頁(yè)面本文實(shí)例圖文相結(jié)合給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-11-11Element?plus中el-input框回車觸發(fā)頁(yè)面刷新問(wèn)題以及解決辦法
在el-form表單組件中el-input組件輸入內(nèi)容后按下Enter鍵刷新了整個(gè)頁(yè)面,下面這篇文章主要給大家介紹了關(guān)于Element?plus中el-input框回車觸發(fā)頁(yè)面刷新問(wèn)題以及解決辦法,需要的朋友可以參考下2024-03-03Vite3結(jié)合Svelte3使用@import導(dǎo)入scss樣式
這篇文章主要為大家介紹了Vite3結(jié)合Svelte3使用@import導(dǎo)入scss樣式實(shí)現(xiàn)實(shí)例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-06-06實(shí)用的 vue tags 創(chuàng)建緩存導(dǎo)航的過(guò)程實(shí)現(xiàn)
這篇文章主要介紹了實(shí)用的 vue tags 創(chuàng)建緩存導(dǎo)航的過(guò)程實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-12-12