亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vue-admin-template配置快捷導航的代碼(標簽導航欄)

 更新時間:2020年09月04日 10:51:47   作者:周數(shù)  
這篇文章主要介紹了vue-admin-template配置快捷導航的方法(標簽導航欄),本文通過實例代碼給大家介紹的非常詳細,對大家學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

vue-element-admin有關(guān)快捷導航說明

1、添加標簽
@/layout/components/AppMain.vue添加:

<template>
 <section class="app-main">
  <transition name="fade-transform" mode="out-in">
   <keep-alive :include="cachedViews">  <!-- 新增 -->
    <router-view :key="key" />
   </keep-alive>      <!-- 新增 -->
  </transition>
 </section>
</template>

2、復制admin項目中的文件
@/layout/components/TagsView
@/store/modules/tagsView.js
到template對應的目錄下
3、修改文件
@store/getters.js

const getters = {
 sidebar: state => state.app.sidebar,
 device: state => state.app.device,
 token: state => state.user.token,
 avatar: state => state.user.avatar,
 name: state => state.user.name,
 visitedviews: state => state.tagsview.visitedviews //新增
}
export default getters

@store/index.js

import tagsView from './modules/tagsView' //新增

Vue.use(Vuex)

const store = new Vuex.Store({
 modules: {
  app,
  settings,
  user,
  tagsView  //新增
 },
 getters
})

export default store 

@\layout\index.vue

<template>
 <div :class="classObj" class="app-wrapper">
  <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
  <sidebar class="sidebar-container" />
  <div class="main-container">
   <div :class="{'fixed-header':fixedHeader}">
    <navbar />
    <tags-view />  <!-- 新增 -->
   </div>
   <app-main />
  </div>
 </div>
</template>

<script>
import { Navbar, Sidebar, AppMain,TagsView } from './components'  //新增

@layout\components\index.js

export { default as TagsView } from './TagsView' // 新增

Affix 固釘
當在聲明路由是 添加了 Affix 屬性,則當前tag會被固定在 tags-view中(不可被刪除)。

在這里插入圖片描述

{
  path: '/',
  component: Layout,
  redirect: '/dashboard',
  children: [
   {
    path: 'dashboard',
    component: () => import('@/views/dashboard/index'),
    name: 'dashboard',
    meta: { title: 'dashboard', icon: 'dashboard', affix: true }
   }
  ]
 },

總結(jié)

到此這篇關(guān)于vue-admin-template配置快捷導航(標簽導航欄)的文章就介紹到這了,更多相關(guān)vue-admin-template導航內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論