- router.ts中去掉mode: ‘history’,
const router = new Router({
// mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/',
name: 'login',
meta: { title: '登录' },
component: () => import(/* webpackChunkName: "about" */ './views/auth/login.vue'),
},]
......
- 根目录新增 vue.config.js 文件
module.exports = {
publicPath: './'
};
额,写博客我才发现,我加的是js文件,enmmm,但是改成ts文件有不太行,有没有大佬可以帮忙解决一下~~