mhl18820672087
低-调
采纳率0%
2021-03-03 22:39

vue3.0 使用render函数渲染子路由承载组件为啥不生效?

{

    path: "/",

    component: () =>

      import( /* webpackChunkName: "layout" */ "../layouts/BasicLayout.vue"),

    children: [

      {

        path: "/",

        redirect: "/dashboard/analysis"

      },

      // {

      //   path: "/dashboard/Analysis",

      //   name: "dashboard",

      //   component: () =>import(/* webpackChunkName: "dashboard" */ "../views/Dashboard/Analysis.vue")

      // }

      {

        path: "/dashboard",

        name: "dashboard",

        component: {

          render: () => h("router-view")

        },

        children: [

          {

            path: "/dashboard/analysis",

            name: "analysis",

            component: () =>import(/* webpackChunkName: "dashboard" */ "../views/Dashboard/Analysis.vue")

          }

        ]

      }

    ]

  }

 

vue3.0 使用render函数渲染子路由承载组件为啥不生效?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

为你推荐