From 06a6486fd5f5db31398a82c378e37d0da505f248 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Sat, 2 Apr 2022 14:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E7=BB=84=E4=BB=B6=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 0ce1088..bc69db2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +2,6 @@ import { createRouter, createWebHashHistory } from "vue-router"; import Home from "@/views/home.vue"; import { defineAsyncComponent, defineComponent } from "vue"; -var b=defineAsyncComponent(async()=>await import("@/views/demo.vue").then(v=>({...v.default,name:'ddd'}))) const routes = [ { path: "/", @@ -12,7 +11,10 @@ const routes = [ { path: "/demo", name: "demo", - component: b, + component: import('@/views/demo.vue').then(e=>{ + e.default.name='demo' //组件命名 + return e + }), }, ]; const router = createRouter({