1.修改Vue.config.js文件
加上:publicPath: './'
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
publicPath: './'
})
2.如果有用到路由的话,则还需修改路由的index.ts文件
修改路由模式:createWebHashHistory
const router = createRouter({
history: createWebHashHistory(process.env.BASE_URL),
routes
})
再次打包即可!!!
本文来自博客园,作者:最帅爸爸,转载请注明原文链接:https://www.cnblogs.com/zsbb
浙公网安备 33010602011771号