美文网首页
VUE部署报We're sorry but duty doesn

VUE部署报We're sorry but duty doesn

作者: hongzhenw | 来源:发表于2022-09-25 10:27 被阅读0次

    本地运行正常,部署到服务上,访问页面一片空白,开发者模式查看,发现报

    <noscript>
    "<strong>We're sorry but duty doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>"
    </noscript>
    

    经百度,最简单的处理方法是在vue.config.js里配置如下

    publicPath: './',
    

    vue.config.js的完整配置如下

    const { defineConfig } = require('@vue/cli-service')
    module.exports = defineConfig({
      publicPath: './',
      transpileDependencies: true
    })
    

    配置完成后,页面访问正常!!!

    相关文章

      网友评论

          本文标题:VUE部署报We're sorry but duty doesn

          本文链接:https://www.haomeiwen.com/subject/qdbtartx.html