vue-cil browser console error: Can not read property 'protocol' of undefined

Browser error console:

' Cannot read property ‘protocol’ of undefined'

Screenshot:

1760387-c93b5c84838fa4b3.png
Error .png

the reason:

This error is caused by an error introduced axios

Screenshot:

1760387-93a6d3f5e8ce2b0f.png
Error introduced .png

That can not be used Vue.use (axios); introduced

How to introduce axios correct?

Look workaround below.

Solution:

Proper use is
Vue.prototype $ axios = axios.;

Screenshot:

1760387-cb520ee404050634.png
Correct posture introduced .png

Thank you for Yu Lan!

Guess you like

Origin blog.csdn.net/weixin_34023863/article/details/91031680