|
|
@ -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({ |
|
|
|