+ Edit{{foo}}
components/HelloWorld.vue to test hot module replacement.
+
diff --git a/src/main.js b/src/main.js
index fbc56f2..6fbdc9b 100644
--- a/src/main.js
+++ b/src/main.js
@@ -4,7 +4,9 @@ import router from './router'
import store from '@/store'
console.log(import.meta.env,'--------------import------')
-createApp(App)
- .use(router)
+var app=createApp(App)
+app.use(router)
.use(store)
.mount('#app')
+
+app.config.globalProperties.foo='===foo====' // 全局配置属性
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index 13f1855..9438ab6 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,19 +1,21 @@
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: "/",
- name: "Home",
- component: Home,
+ name: "home",
+ component: {...Home,name:"dhome"},
},
{
path: "/demo",
name: "demo",
- component: import("@/views/demo.vue"),
+ component: b,
},
];
-
+window.r=routes
const router = createRouter({
history: createWebHashHistory(),
routes,
diff --git a/src/views/Demo.vue b/src/views/Demo.vue
index ff6f779..f7ddeda 100644
--- a/src/views/Demo.vue
+++ b/src/views/Demo.vue
@@ -2,8 +2,13 @@
-
demo
+
demo page
\ No newline at end of file
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 9caf9d9..a99fae0 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -2,9 +2,10 @@
+