parent
d396fb0e5b
commit
4ca2a5e4d5
7 changed files with 69 additions and 48 deletions
@ -1,4 +1,5 @@ |
|||||||
import {createApp} from "vue"; |
import {createApp} from "vue"; |
||||||
import App from "./App.vue" |
import App from "./App.vue" |
||||||
|
import router from './router' |
||||||
|
|
||||||
createApp(App).mount('#app') |
createApp(App).use(router).mount('#app') |
||||||
|
@ -0,0 +1,22 @@ |
|||||||
|
import { createRouter, createWebHashHistory } from 'vue-router' |
||||||
|
import HomeView from '../views/HomeView.vue' |
||||||
|
|
||||||
|
const routes = [ |
||||||
|
{ |
||||||
|
path: '/', |
||||||
|
name: 'home', |
||||||
|
component: HomeView |
||||||
|
}, |
||||||
|
{ |
||||||
|
path: '/about', |
||||||
|
name: 'about', |
||||||
|
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue') |
||||||
|
} |
||||||
|
] |
||||||
|
|
||||||
|
const router = createRouter({ |
||||||
|
history: createWebHashHistory(), |
||||||
|
routes |
||||||
|
}) |
||||||
|
|
||||||
|
export default router |
@ -0,0 +1,3 @@ |
|||||||
|
<template> |
||||||
|
<h3>这是About</h3> |
||||||
|
</template> |
@ -0,0 +1,3 @@ |
|||||||
|
<template> |
||||||
|
<h3>这是Home</h3> |
||||||
|
</template> |
Loading…
Reference in new issue