参考:
一、从vue-element-admin复制文件:
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文件,新增以下内容:
export default{
name:'AppMain',
computed: {
cachedViews() {return this.$store.state.tagsView.cachedViews
}/*,
key() {
return this.$route.path
}*/}
}
.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;
}}
三、修改vue-admin-template\src\layout\components\index.js,新增如下行:
export { default as TagsView } from './TagsView'
四、vue-admin-template\src\layout\index.vue