npm init vite@latest
cd test
npm install
npm install vue-router@next --save
npm install vuex@next --save
npm run dev
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
{path:'/',name: 'home',component: () => import('@/views/Home.vue')},
{path:'/about',name: 'about',component: () => import('@/views/About.vue')},
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router
import { createStore } from 'vuex'
const store = createStore({
state: {
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
}
})
export default store
https://www.cnblogs.com/ToBeBest/