Vue-element-admin: npm run preview打开页面空白

Created on 9 Aug 2019  ·  5Comments  ·  Source: PanJiaChen/vue-element-admin

Bug report(问题描述)

使用npm run preview 打包成功生成dist文件夹,使用file协议可以打开dist目录下的index文件出现登录界面,可是使用http://localhost:9526/访问时页面空白

Steps to reproduce(问题复现步骤)

npm run preview
使用浏览器打开 http://localhost:9526/

Screenshot or Gif(截图或动态图)

image

image

Other relevant information(格外信息)

bug enhancement

Most helpful comment

出现 http://localhost:9526./ 的原因是设置了publicPath为'./', 改成 '/'即可 , 运行 npm run preview -- --report 即可查看

All 5 comments

image

为什么多了一个 . ?

不知道为啥,运行preview就自动生成了这个浏览网址

现在我也出现了这种情况
npm run preview -- --report 以后出现的网址是> Preview at http://localhost:9526./

我也遇到这个问题了~~~ 这是为嘛? 你们解决了吗?

出现 http://localhost:9526./ 的原因是设置了publicPath为'./', 改成 '/'即可 , 运行 npm run preview -- --report 即可查看

Was this page helpful?
0 / 5 - 0 ratings