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 })
再次打包即可!!!
标签:Vue,const,启动,publicPath,打包,路由,defineConfig From: https://www.cnblogs.com/zsbb/p/16925261.html