参考:https://blog.csdn.net/weixin_44917334/article/details/129387658
history 模式由createWebHistory改为createWebHashHistory
import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router' import HomeView from '../views/HomeView.vue' import LoginView from '../views/LoginView.vue' const router = createRouter({ history: createWebHashHistory(import.meta.env.BASE_URL), routes: [ { path: '/', name: 'home', component: HomeView, meta: { title: '首页' } }, { path: '/login', name: 'login', component: LoginView, meta: { title: '登录' } } ] })
标签:vue,LoginView,HomeView,H5,404,meta,import,createWebHashHistory,页面 From: https://www.cnblogs.com/liuyongfa/p/17587911.html