最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue-admin-template模板添加tagsview的實現(xiàn)

 更新時間:2022年04月28日 09:43:47   作者:小飛豬咯咯  
本文主要介紹了vue-admin-template模板添加tagsview的實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

一、從vue-element-admin復(fù)制文件

vue-admin-template\src\layout\components\TagsView 文件夾
vue-admin-template\src\store\modules\tagsView.js
#vue-admin-template\static 文件夾
#vue-admin-template\src\lang 文件夾
#vue-admin-template\src\utils\i18n.js

二、修改 vue-admin-template\src\layout\components\AppMain.vue

AppMain.vue文件,新增以下內(nèi)容:

<template>
  <section class="app-main">
    <transition name="fade-transform" mode="out-in">
     <!-- <router-view :key="key" />-->
      <keep-alive :include="cachedViews">
        <router-view></router-view>
      </keep-alive>
    </transition>
  </section>
</template>
export default {
  name: 'AppMain',
  computed: {
    cachedViews() {
      return this.$store.state.tagsView.cachedViews
    }/*,
    key() {
      return this.$route.path
    }*/
  }
}
<style lang="scss" scoped>
.app-main {
  /*50 = navbar  */
  min-height: calc(100vh - 50px);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.fixed-header + .app-main {
  padding-top: 50px;
}

.hasTagsView {
  .app-main {
    /* 84 = navbar + tags-view = 50 + 34 */
    min-height: calc(100vh - 84px);
  }

  .fixed-header+.app-main {
    padding-top: 84px;
  }
}
</style>

三、修改vue-admin-template\src\layout\components\index.js

新增如下行:

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

四、vue-admin-template\src\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 />
      </div>
      <tags-view />    <!-- 此處增加tag-->
      <app-main />
    </div>
  </div>
</template>
import { Navbar, Sidebar, AppMain, TagsView } from './components'
components: {
    Navbar,
    Sidebar,
    AppMain,
    TagsView
  },

五、修改 vue-admin-template\src\store\getters.js

增加:

visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,

六、修改 vue-admin-template\src\store\index.js

import tagsView from './modules/tagsView'
const store = new Vuex.Store({
  modules: {
    app,
    permission,
    settings,
    tagsView,
    user
  },
  getters
})

七、修改 vue-admin-template\src\main.js

import i18n from './lang' // Internationalization
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})

八、修改vue-admin-template\src\settings.js 添加

tagsView: true,

九、修改vue-admin-template\src\store\modules\settings.js

const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings

const state = {
  showSettings: showSettings,
  tagsView: tagsView,
  fixedHeader: fixedHeader,
  sidebarLogo: sidebarLogo
}

解決控制臺報錯:

1、刪除vue-admin-template\src\layout\components\TagsView\index.vue中routes方法

(因為沒有用到權(quán)限校驗)

2、遍歷標(biāo)簽時可能報錯

參考

https://github.com/PanJiaChen/vue-admin-template/issues/349

到此這篇關(guān)于vue-admin-template模板添加tagsview的實現(xiàn)的文章就介紹到這了,更多相關(guān)vue-admin-template模板添加tagsview內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 詳解在Vue中如何使用axios跨域訪問數(shù)據(jù)

    詳解在Vue中如何使用axios跨域訪問數(shù)據(jù)

    本篇文章主要介紹了在Vue中如何使用axios跨域訪問數(shù)據(jù),小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-07-07
  • 詳解如何將 Vue-cli 改造成支持多頁面的 history 模式

    詳解如何將 Vue-cli 改造成支持多頁面的 history 模式

    本篇文章主要介紹了詳解如何將 Vue-cli 改造成支持多頁面的 history 模式,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-11-11
  • Vue中裝飾器的使用示例詳解

    Vue中裝飾器的使用示例詳解

    Vue?Property?Decorator提供了一些裝飾器,包括@Prop、@Watch、@Emit、@Inject、@Provide、@Model等等,本文主要來和大家講講它們的使用方法,需要的可以參考一下
    2023-07-07
  • 對Vue table 動態(tài)表格td可編輯的方法詳解

    對Vue table 動態(tài)表格td可編輯的方法詳解

    今天小編就為大家分享一篇對Vue table 動態(tài)表格td可編輯的方法詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-08-08
  • 淺析Vue.js 中的條件渲染指令

    淺析Vue.js 中的條件渲染指令

    這篇文章主要介紹了Vue.js 中的條件渲染指令,Vue.js 中的條件渲染指令可以根據(jù)表達(dá)式的值,來決定在 DOM 中是渲染還是銷毀元素或組件。本文通過實例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下
    2018-11-11
  • 詳解Vue.js Mixins 混入使用

    詳解Vue.js Mixins 混入使用

    本篇文章主要介紹了Vue.js Mixins 混入使用,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-09-09
  • Vue.js響應(yīng)式數(shù)據(jù)的簡單實現(xiàn)方法(一看就會)

    Vue.js響應(yīng)式數(shù)據(jù)的簡單實現(xiàn)方法(一看就會)

    Vue最巧妙的特性之一是其響應(yīng)式系統(tǒng),下面這篇文章主要給大家介紹了關(guān)于Vue.js響應(yīng)式數(shù)據(jù)的簡單實現(xiàn)方法,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-03-03
  • vue項目實現(xiàn)多語言切換的思路

    vue項目實現(xiàn)多語言切換的思路

    這篇文章主要介紹了vue項目實現(xiàn)多語言切換的思路,幫助大家完成多語言翻譯,感興趣的朋友可以了解下
    2020-09-09
  • Element Plus的el-icon怎么用

    Element Plus的el-icon怎么用

    在Element Plus里,Icon圖標(biāo)的用法和以前不一樣了,本文主要介紹了Element Plus的el-icon怎么用,具有一定的參考價值,感興趣的可以了解一下
    2022-04-04
  • elementUI Tree 樹形控件的官方使用文檔

    elementUI Tree 樹形控件的官方使用文檔

    這篇文章主要介紹了elementUI Tree 樹形控件的官方使用文檔,用清晰的層級結(jié)構(gòu)展示信息,可展開或折疊。小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-04-04

最新評論

韶山市| 莱阳市| 汽车| 贡山| 开封市| 错那县| 乐亭县| 隆回县| 肃北| 德令哈市| 澄迈县| 广南县| 喀什市| 景谷| 连山| 左权县| 北安市| 仙游县| 建阳市| 邢台县| 格尔木市| 体育| 德庆县| 茶陵县| 左云县| 平利县| 邹平县| 石林| 芦山县| 东辽县| 通辽市| 贡觉县| 洪湖市| 青龙| 湘乡市| 凉城县| 左云县| 常宁市| 观塘区| 武宁县| 桂平市|