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
})

再次打包即可!!!

posted on 2022-11-25 15:17  最帅爸爸  阅读(87)  评论(0)    收藏  举报