今天在测试axios的时候发现了这样一个问题
[Vue warn]: Error in created hook: "TypeError: Cannot read property 'get' of undefined" 如下图
出现这个的原因是没有正确加载axios。
如下图是在错误的情况下写的:
正确的写法是:
换了一下位置就可以了。
还有一个问题是 net::ERR_CONNECTION_REFUSED
这个解决的方式是看后端的服务器有没有开启。
今天在测试axios的时候发现了这样一个问题
[Vue warn]: Error in created hook: "TypeError: Cannot read property 'get' of undefined" 如下图
出现这个的原因是没有正确加载axios。
如下图是在错误的情况下写的:
正确的写法是:
换了一下位置就可以了。
还有一个问题是 net::ERR_CONNECTION_REFUSED
这个解决的方式是看后端的服务器有没有开启。