简化写法

Former-commit-id: 629be5c2cda97a02cb72faf528b1791a6dcc4f37
This commit is contained in:
liyang
2019-01-09 21:12:36 +08:00
parent b0acc2edd9
commit b2a5dd96ee
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -56,11 +56,8 @@ router.beforeEach((to, from, next) => {
router.afterEach(to => {
// 进度条
NProgress.done()
// 需要的信息
const app = router.app
const { name, params, query, fullPath } = to
// 多页控制 打开新的页面
app.$store.dispatch('d2admin/page/open', { name, params, query, fullPath })
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(to.meta.title)
})
+1 -1
View File
@@ -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 => {