Commit 3db1dad0 authored by 周远喜's avatar 周远喜

打开页面处理

parent e67f7a54
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 多标签页 * 多标签页
* */ * */
import { get } from 'lodash'; import { get } from 'lodash';
import router from '@/router'; // import router from '@/router';
import Setting from '@/setting'; import Setting from '@/setting';
import menuSider from '@/menu/sider'; import menuSider from '@/menu/sider';
import { getAllSiderMenu, includeArray } from '@/libs/system'; import { getAllSiderMenu, includeArray } from '@/libs/system';
...@@ -245,7 +245,7 @@ export const actions={ ...@@ -245,7 +245,7 @@ export const actions={
params, params,
query query
}; };
router.push(routerObj, () => {}); $nuxt.$router.push(routerObj, () => {});
} }
// end // end
resolve(); resolve();
...@@ -269,8 +269,8 @@ export const actions={ ...@@ -269,8 +269,8 @@ export const actions={
state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name)); state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name));
} }
state.current = pageAim; state.current = pageAim;
if (router.app.$route.fullPath !== pageAim) { if ($nuxt.$router.fullPath !== pageAim) {
router.push(pageAim); $nuxt.$router.push(pageAim);
} }
// 持久化 // 持久化
await dispatch('opened2db'); await dispatch('opened2db');
...@@ -295,8 +295,8 @@ export const actions={ ...@@ -295,8 +295,8 @@ export const actions={
state.opened.splice(currentIndex + 1).forEach(({ name }) => commit('keepAliveRemove', name)); state.opened.splice(currentIndex + 1).forEach(({ name }) => commit('keepAliveRemove', name));
// 设置当前的页面 // 设置当前的页面
state.current = pageAim; state.current = pageAim;
if (router.app.$route.fullPath !== pageAim) { if ($nuxt.$router.fullPath !== pageAim) {
router.push(pageAim); $nuxt.$router.push(pageAim);
} }
// 持久化 // 持久化
await dispatch('opened2db'); await dispatch('opened2db');
...@@ -326,8 +326,8 @@ export const actions={ ...@@ -326,8 +326,8 @@ export const actions={
} }
// 设置新的页面 // 设置新的页面
state.current = pageAim; state.current = pageAim;
if (router.app.$route.fullPath !== pageAim) { if ($nuxt.$router.fullPath !== pageAim) {
router.push(pageAim); $nuxt.$router.push(pageAim);
} }
// 持久化 // 持久化
await dispatch('opened2db'); await dispatch('opened2db');
...@@ -346,8 +346,8 @@ export const actions={ ...@@ -346,8 +346,8 @@ export const actions={
// 持久化 // 持久化
await dispatch('opened2db'); await dispatch('opened2db');
// 关闭所有的标签页后需要判断一次现在是不是在首页 // 关闭所有的标签页后需要判断一次现在是不是在首页
if (router.app.$route.name !== 'index') { if ($nuxt.$router.name !== 'index') {
router.push({ $nuxt.$router.push({
name: 'index' name: 'index'
}, () => {}); }, () => {});
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment