优化代码

Former-commit-id: 15cf34c9ad219e1fe927c6a2fc12238b828e8d41 [formerly 9abe1f515b714236d6f6001b07c264aa4478f0a5] [formerly 15cf34c9ad219e1fe927c6a2fc12238b828e8d41 [formerly 9abe1f515b714236d6f6001b07c264aa4478f0a5] [formerly 15cf34c9ad219e1fe927c6a2fc12238b828e8d41 [formerly 9abe1f515b714236d6f6001b07c264aa4478f0a5] [formerly 9abe1f515b714236d6f6001b07c264aa4478f0a5 [formerly cc0373eb9690aed16a342ae2d17a180b178a6a71 [formerly 6b729125ce244ec16d3e23e5a89569622894b993]]]]]
Former-commit-id: 899d8fd267bcc2e511330c0290ccc460a5c4f20e
Former-commit-id: 85adbc0644ba410f197ac5c1753cbfe66878248d
Former-commit-id: b70047dffdc406f1ab1cc061d94ca99b1fc37229 [formerly 9b77b015e14ab573c98cdc777855cf504c6c4abe]
Former-commit-id: eb91f16efdc4d2895cc6e3eda24c3632c7899992
Former-commit-id: a1396131588a0eb54df97a4fff2efdd9ca84a18d
Former-commit-id: 2135c33b9317db787cfda7f1983dcb7d7cb01feb
Former-commit-id: 57ee841d100af4e390129d5ba71a57b03804f305
Former-commit-id: 3fc77ebb7561f32c50b2bdf9fa92dce80449dd34
This commit is contained in:
liyang
2018-07-15 23:00:37 +08:00
parent 7205ba8155
commit b1c02025e8
2 changed files with 5 additions and 8 deletions

View File

@@ -97,12 +97,9 @@ export default {
handleClick (tab, event) {
// 找到点击的页面在 tag 列表里是哪个
const page = this.pageOpenedList.find(page => page.name === tab.name)
const { name, params, query } = page
if (page) {
this.$router.push({
name: page.name,
params: page.params,
query: page.query
})
this.$router.push({ name, params, query })
}
},
/**

View File

@@ -128,19 +128,19 @@ new Vue({
*/
getAllTagFromRoutes () {
// 所有加载在主框架内的页面
const tagPool = []
const pool = []
const push = function (routes) {
routes.forEach(route => {
if (route.children) {
push(route.children)
} else {
const { meta, name, path } = route
tagPool.push({ meta, name, path })
pool.push({ meta, name, path })
}
})
}
push(frameInRoutes)
this.$store.commit('d2adminTagPoolSet', tagPool)
this.$store.commit('d2adminTagPoolSet', pool)
}
}
})