Skip to content

Commit

Permalink
简化传参
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyEver committed Jan 9, 2019
1 parent 1814e22 commit 1fb7417
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ router.beforeEach((to, from, next) => {
}
})

router.afterEach(({ name, params, query, fullPath, meta }) => {
router.afterEach((to) => {
// 进度条
NProgress.done()
// 多页控制 打开新的页面
store.dispatch('d2admin/page/open', { name, params, query, fullPath })
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(meta.title)
util.title(to.meta.title)
})

export default router
2 changes: 1 addition & 1 deletion src/store/modules/d2admin/modules/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default {
* @class current
* @description 打开一个新的页面
* @param {Object} state vuex state
* @param {Object} param { name, params, query, fullPath } 路由信息
* @param {Object} param 从路由钩子的 to 对象上获取 { name, params, query, fullPath } 路由信息
*/
open ({ state, commit, dispatch }, { name, params, query, fullPath }) {
return new Promise(async resolve => {
Expand Down

0 comments on commit 1fb7417

Please sign in to comment.