Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

刷新页面导致报表组件加载了两次 #1417

Open
HyalineSoft opened this issue Mar 14, 2023 · 0 comments
Open

刷新页面导致报表组件加载了两次 #1417

HyalineSoft opened this issue Mar 14, 2023 · 0 comments
Labels
question Further information is requested

Comments

@HyalineSoft
Copy link

HyalineSoft commented Mar 14, 2023

Question (问题描述)

按F5刷新/home/test渲染了两次页面,但跳转到/home/test正常只渲染一次。

Describe the solution you'd like (你期待的是什么?)
希望在按F5刷新页面时只让/home/test加载一次而不是两次。

Additional context(附加信息)
Ant Design Vue 版本:1.4.4,Vue版本:2.6.10。
目前推测和router配置有关,但由于项目大路由嵌套深,所以不知道如何修改。以下是路由配置。

import { BasicLayout, PageView } from "@/layouts";

export default [
  {
    path: "/",
    component: BasicLayout,
    meta: { title: "测试报表" },
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "test",
        redirect: "/home/test",
        components: {
          sidemenu: () => import("@/layouts/Report/ReportSideMenu.vue"),
          multitab: () => import("@/layouts/MultiTab.vue"),
          default: PageView,
        },
        hideChildrenInMenu: true,
        meta: { title: "测试报表", keepAlive: true },
        children: [
          {
            path: "/home/test",
            name: "home.test",
            component: () => import("@/views/Report/TestReport"),
            meta: { title: "测试报表", keepAlive: true }
          }
        ]
      }
    ]
  }
]
@HyalineSoft HyalineSoft added the question Further information is requested label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant