diff --git a/src/index/router.js b/src/index/router.js
index 9e03a62..b855f2e 100644
--- a/src/index/router.js
+++ b/src/index/router.js
@@ -1,7 +1,7 @@
import Vue from 'vue'
import Router from 'vue-router'
-import Home from './views/Home.vue'
-import About from './views/About.vue'
+import Home from '@/views/Home.vue'
+import About from '@/views/About.vue'
Vue.use(Router)
diff --git a/src/router/router.js b/src/router/router.js
new file mode 100644
index 0000000..f2fe464
--- /dev/null
+++ b/src/router/router.js
@@ -0,0 +1,26 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+import Home from '@/views/Home.vue'
+
+Vue.use(VueRouter)
+
+const routes = [
+ {
+ path: '/',
+ name: 'Home',
+ component: Home
+ },
+ {
+ path: '/about',
+ name: 'About',
+ component: () => import(/* webpackChunkName: "about" */ '@/views/About.vue')
+ }
+]
+
+const router = new VueRouter({
+ // mode: 'history',
+ base: process.env.BASE_URL,
+ routes
+})
+
+export default router
\ No newline at end of file
diff --git a/src/subpage/App.vue b/src/subpage/App.vue
deleted file mode 100644
index 97c3ca7..0000000
--- a/src/subpage/App.vue
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
diff --git a/src/subpage/main.js b/src/subpage/main.js
deleted file mode 100644
index e1d39a0..0000000
--- a/src/subpage/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import Vue from 'vue'
-import App from './App.vue'
-import router from './router'
-import store from '@/store'
-
-Vue.config.productionTip = false
-
-new Vue({
- router,
- store,
- render: h => h(App)
-}).$mount('#app')
diff --git a/src/subpage/views/About.vue b/src/subpage/views/About.vue
deleted file mode 100644
index 3fa2807..0000000
--- a/src/subpage/views/About.vue
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
This is an about page
-
-
diff --git a/src/subpage/views/Home.vue b/src/subpage/views/Home.vue
deleted file mode 100644
index 4c43a45..0000000
--- a/src/subpage/views/Home.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/index/views/About.vue b/src/views/About.vue
similarity index 100%
rename from src/index/views/About.vue
rename to src/views/About.vue
diff --git a/src/index/views/Home.vue b/src/views/Home.vue
similarity index 100%
rename from src/index/views/Home.vue
rename to src/views/Home.vue
diff --git a/vue.config.js b/vue.config.js
index 5b61afd..756df99 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -9,8 +9,8 @@ module.exports = {
// build 生成的文件名称 例: dist/index.html
filename: 'index.html'
},
- // template 默认会去找 public/subpage.html 页面,如果找不到会使用 public/index.html 文件
- // 输出文件会默认的推断为 subpage.html
- subpage: 'src/subpage/main.js'
+ // template 默认会去找 public/app.html 页面,如果找不到会使用 public/index.html 文件
+ // 输出文件会默认的推断为 app.html
+ app: 'src/app/main.js'
}
}