多页签条件修改

master
toesbieya 6 years ago
parent 944e6d0344
commit 39a253d476
  1. 22
      vue/src/layout/component/TagsView/index.vue
  2. 5
      vue/src/router/index.js

@ -81,19 +81,19 @@ export default {
filterAffixTags(routes) {
const tags = []
routes.forEach(route => {
if (route.name && route.meta && route.meta.affix) {
routes.forEach(({name, fullPath, children, meta}) => {
if (meta && meta.title && meta.affix) {
tags.push({
//fullPath$route.fullPath
fullPath: route.fullPath,
path: route.fullPath,
name: route.name,
meta: {...route.meta}
fullPath,
path: fullPath,
name,
meta: {...meta}
})
}
if (route.children) {
const tempTags = this.filterAffixTags(route.children)
tempTags.length > 0 && tags.push(...tempTags)
if (children) {
const tempTags = this.filterAffixTags(children)
tempTags.length && tags.push(...tempTags)
}
})
return tags
@ -105,9 +105,9 @@ export default {
}
},
//nametab
//titletab
addTags(to = this.$route) {
return to.name ? this.$store.dispatch('tagsView/addView', to) : Promise.resolve()
return to.meta.title ? this.$store.dispatch('tagsView/addView', to) : Promise.resolve()
},
//tab

@ -6,9 +6,8 @@
* 左侧菜单排序能在左侧菜单中显示 && meta.sort升序排列
* 左侧菜单不折叠只有一个children的路由meta.alwaysShow
* 面包屑显示meta.title || meta.dynamicTitle
* 搜索选项显示name && meta.title
* tab栏显示name && (meta.title || meta.dynamicTitle)
* tab栏固定显示meta.affix
* tab栏显示meta.title || meta.dynamicTitle
* tab栏固定显示meta.title && meta.affix
* 页面不缓存!name && !meta.usePathKey && !meta.useFullPathKey || meta.noCache
* 打开iframemeta.iframe不会重复打开相同src的iframe
* */

Loading…
Cancel
Save