diff --git a/src/App.vue b/src/App.vue
index 1239a1c..ed60c58 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -20,7 +20,7 @@
import { RouterView } from "vue-router";
import routes from "@/router/routes";
import Layout from "./components/Layout.vue";
-// import VHeader from './components/VHeader.vue'
+import VHeader from "./components/VHeader.vue";
import SideMenu from "./components/SideMenu.vue";
diff --git a/src/components/ComponentA.vue b/src/components/ComponentA.vue
new file mode 100644
index 0000000..4227b60
--- /dev/null
+++ b/src/components/ComponentA.vue
@@ -0,0 +1,16 @@
+
+
+ A组件
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ComponentB.vue b/src/components/ComponentB.vue
new file mode 100644
index 0000000..228aa10
--- /dev/null
+++ b/src/components/ComponentB.vue
@@ -0,0 +1,16 @@
+
+
+ B组件
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ComponentC.vue b/src/components/ComponentC.vue
new file mode 100644
index 0000000..e1d462e
--- /dev/null
+++ b/src/components/ComponentC.vue
@@ -0,0 +1,16 @@
+
+
+ C组件
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/installComponents.ts b/src/installComponents.ts
index 63adbfb..d93b4ec 100644
--- a/src/installComponents.ts
+++ b/src/installComponents.ts
@@ -1,8 +1,12 @@
import type { App } from "vue";
-import VHeader from "./components/VHeader.vue";
+import ComponentA from "./components/ComponentA.vue";
+import ComponentB from "./components/ComponentB.vue";
+// import ComponentC from "./components/ComponentC.vue";
const install = function (app: App) {
- app.component("VHeader", VHeader)
+ app.component("ComponentA", ComponentA);
+ app.component("ComponentB", ComponentB);
+ // app.component("ComponentC", ComponentC);
};
export {
diff --git a/src/router/routes.ts b/src/router/routes.ts
index fa1531c..bbf2890 100644
--- a/src/router/routes.ts
+++ b/src/router/routes.ts
@@ -123,6 +123,18 @@ const routes = [
name: "partComponent",
meta: { title: "局部组件" },
component: () => import("@/views/component/PartComponent.vue")
+ },
+ {
+ path: "/component/var",
+ name: "varComponent",
+ meta: { title: "动态组件" },
+ component: () => import("@/views/component/VarComponent.vue")
+ },
+ {
+ path: "/component/varadvan",
+ name: "varComponentAdvan",
+ meta: { title: "动态组件" },
+ component: () => import("@/views/component/VarComponentAdvan.vue")
}
]
}
diff --git a/src/views/component/GlobalComponent.vue b/src/views/component/GlobalComponent.vue
index f9a8654..3b2b00a 100644
--- a/src/views/component/GlobalComponent.vue
+++ b/src/views/component/GlobalComponent.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/views/component/PartComponent.vue b/src/views/component/PartComponent.vue
index 8e8347f..0511c81 100644
--- a/src/views/component/PartComponent.vue
+++ b/src/views/component/PartComponent.vue
@@ -1,13 +1,13 @@
-
+
-
\ No newline at end of file
diff --git a/src/views/component/VarComponent.vue b/src/views/component/VarComponent.vue
new file mode 100644
index 0000000..1f22b3a
--- /dev/null
+++ b/src/views/component/VarComponent.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/component/VarComponentAdvan.vue b/src/views/component/VarComponentAdvan.vue
new file mode 100644
index 0000000..6e80d59
--- /dev/null
+++ b/src/views/component/VarComponentAdvan.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file