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

打开页面处理

parent e67f7a54
......@@ -2,7 +2,7 @@
* 多标签页
* */
import { get } from 'lodash';
import router from '@/router';
// import router from '@/router';
import Setting from '@/setting';
import menuSider from '@/menu/sider';
import { getAllSiderMenu, includeArray } from '@/libs/system';
......@@ -245,7 +245,7 @@ export const actions={
params,
query
};
router.push(routerObj, () => {});
$nuxt.$router.push(routerObj, () => {});
}
// end
resolve();
......@@ -269,8 +269,8 @@ export const actions={
state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name));
}
state.current = pageAim;
if (router.app.$route.fullPath !== pageAim) {
router.push(pageAim);
if ($nuxt.$router.fullPath !== pageAim) {
$nuxt.$router.push(pageAim);
}
// 持久化
await dispatch('opened2db');
......@@ -295,8 +295,8 @@ export const actions={
state.opened.splice(currentIndex + 1).forEach(({ name }) => commit('keepAliveRemove', name));
// 设置当前的页面
state.current = pageAim;
if (router.app.$route.fullPath !== pageAim) {
router.push(pageAim);
if ($nuxt.$router.fullPath !== pageAim) {
$nuxt.$router.push(pageAim);
}
// 持久化
await dispatch('opened2db');
......@@ -326,8 +326,8 @@ export const actions={
}
// 设置新的页面
state.current = pageAim;
if (router.app.$route.fullPath !== pageAim) {
router.push(pageAim);
if ($nuxt.$router.fullPath !== pageAim) {
$nuxt.$router.push(pageAim);
}
// 持久化
await dispatch('opened2db');
......@@ -346,8 +346,8 @@ export const actions={
// 持久化
await dispatch('opened2db');
// 关闭所有的标签页后需要判断一次现在是不是在首页
if (router.app.$route.name !== 'index') {
router.push({
if ($nuxt.$router.name !== 'index') {
$nuxt.$router.push({
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