多页签条件修改

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) { filterAffixTags(routes) {
const tags = [] const tags = []
routes.forEach(route => { routes.forEach(({name, fullPath, children, meta}) => {
if (route.name && route.meta && route.meta.affix) { if (meta && meta.title && meta.affix) {
tags.push({ tags.push({
//fullPath$route.fullPath //fullPath$route.fullPath
fullPath: route.fullPath, fullPath,
path: route.fullPath, path: fullPath,
name: route.name, name,
meta: {...route.meta} meta: {...meta}
}) })
} }
if (route.children) { if (children) {
const tempTags = this.filterAffixTags(route.children) const tempTags = this.filterAffixTags(children)
tempTags.length > 0 && tags.push(...tempTags) tempTags.length && tags.push(...tempTags)
} }
}) })
return tags return tags
@ -105,9 +105,9 @@ export default {
} }
}, },
//nametab //titletab
addTags(to = this.$route) { 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 //tab

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

Loading…
Cancel
Save