rindy %!s(int64=6) %!d(string=hai) anos
pai
achega
09912bf675
Modificáronse 4 ficheiros con 37 adicións e 15 borrados
  1. 2 1
      package.json
  2. 10 8
      public/index.html
  3. 10 6
      src/router.ts
  4. 15 0
      src/views/shared/Layout.vue

+ 2 - 1
package.json

@@ -3,7 +3,8 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
+    "start": "vue-cli-service serve",
+	"dev": "vue-cli-service serve",
     "build": "vue-cli-service build"
   },
   "dependencies": {

+ 10 - 8
public/index.html

@@ -1,17 +1,19 @@
 <!DOCTYPE html>
-<html lang="en">
-  <head>
+<html lang="zh-CN">
+
+<head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>wuhouci</title>
-  </head>
-  <body>
+    <title>武侯祠艺术之旅</title>
+</head>
+
+<body>
     <noscript>
       <strong>We're sorry but wuhouci doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
     <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
-</html>
+</body>
+
+</html>

+ 10 - 6
src/router.ts

@@ -1,15 +1,19 @@
 import Vue from 'vue'
 import Router from 'vue-router'
+import Layout from './views/shared/Layout.vue'
 import Home from './views/Home.vue'
 
 Vue.use(Router)
 
 export default new Router({
-  routes: [
-    {
-      path: '/',
-      name: 'home',
-      component: Home
+    routes: [{
+        path: '/',
+        component: Layout,
+        children: [{
+            path: '',
+            name: 'home',
+            component: Home
+        }]
     }
-  ]
+    ]
 })

+ 15 - 0
src/views/shared/Layout.vue

@@ -0,0 +1,15 @@
+<template>
+    <div>
+        <router-view :key="key" />
+    </div>
+</template>
+<script lang="ts">
+import Vue from "vue";
+export default Vue.extend({
+    computed: {
+        key(): string {
+            return this.$route.fullPath
+        }
+    }
+});
+</script>