问题:A页面由a、b多个组件构成,点击B页面列表中的数字跳转到A页面,而a、b组件未加载出来,如下图红色框。
跳转后的页面:
跳转前(正常)页面:
在router中再添加子组件即可:
{
path: "/defect",
component: Layout,
meta: { title: "软件缺陷", icon: "link" },
children: [
{
path: "defectStatistics",
component: () => import("@/views/defect/index"),
meta: { title: "缺陷汇总" },
name: "defectStatistics",
children: [
//个人数据/测试人员:点击创建数跳转到缺陷创建页面
{
path: "defectStatisticsCre",
component: () => import("@/views/defect/defectStatistics/defectCreType"),
meta: { title: "新建缺陷" },
name: "defectStatisticsCre",
},
//个人数据/测试人员:点击验证数跳转到缺陷验证页面
{
path: "defectStatisticsVer",
component: () => import("@/views/defect/defectStatistics/defectVerType"),
meta: { title: "验证缺陷" },
name: "defectStatisticsVer",
},