wuhongyu 5 éve
szülő
commit
b1c0ae85ba
3 módosított fájl, 34 hozzáadás és 1 törlés
  1. 7 0
      src/router/index.js
  2. 8 1
      src/views/test.vue
  3. 19 0
      src/views/test2.vue

+ 7 - 0
src/router/index.js

@@ -11,10 +11,17 @@ const live = [
       {
         path: '/test',
         name: 'live_test',
+        meta: { title: '测试', subSite: true },
         component: () => import('../views/test.vue'),
       },
     ],
   },
+  {
+    path: '/test2',
+    name: 'live_test',
+    meta: { title: '测试', subSite: true },
+    component: () => import('../views/test2.vue'),
+  },
 ];
 
 const routes = [...live];

+ 8 - 1
src/views/test.vue

@@ -11,8 +11,15 @@ export default {
   components: {},
   data: () => ({}),
   created() {},
-  computed: {},
   methods: {},
+  computed: {
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
 };
 </script>
 

+ 19 - 0
src/views/test2.vue

@@ -0,0 +1,19 @@
+<template>
+  <div id="test2">
+    <p>test2</p>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'test2',
+  props: {},
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped></style>