原因一:cli3.0已经把静态资源的文件夹改成public文件夹了,所以静态资源应该放置在public文件夹下。
但是!我这样写依旧是报错!
很难受,但是我没有哭。
原因二,访问静态文件的路径不需要public.
因为访问静态资源时,已经定位到public文件夹了!!! 于是去掉public
async getHomeInfo(){
const {data
:res
}=await this.$http
.get('http://localhost:8080/index.json')
console
.log(res
)
}
然后刷新,啦啦啦,成功啦! 完结,撒花花!!!
转载请注明原文地址: https://lol.8miu.com/read-17274.html