vue 打包的问题空白

vue 路由分为hash(默认是hash)和history 

1.当时hash模式,当打包后是空白的,这是因为你的config文件下index.js文件,build对象下没有改成 assetsPublicPath: './',

2.当是history模式的时候,打包后放在ngnix下面,会有404的错误

    (1).404的解决方案

        在ngnix配置  config 下面index.js
        location / {
            root   html;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }

        (2)嵌套子路由出现子路由

                 子路由不能正常显示
                 assetsPublicPath: '/',

猜你喜欢

转载自blog.csdn.net/houdabiao/article/details/82767903