1、安装配置
安装:npm install vue-router
配置:创建router.js
import { createWebHashHistory, createRouter } from 'vue-router'
import Home from './Home.vue'
import About from './About.vue'
const router = createRouter({
history: createWebHashHistory(),
routes: [
{ path: '/', component: Home },
{ path: '/about', component: About},
],
})