Vue3打包相对路径_本地可访问

1.配置打包相对路径

配置文件: vue.config.js
配置属性: publicPath

示例

module.exports = {
  publicPath: './'
}

2.修改路由

路由修改为 [createWebHashHistory]

示例

import {createRouter, createWebHashHistory} from 'vue-router'
import {staticRouter} from '@/core/router/xstech'

const router = createRouter({
    history: createWebHashHistory(),
    routes: staticRouter
})

创建时间 2022年2月27日
更新时间 2022年2月27日