Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

axios 在store文件里是用于获取数据,在main.js 是要往vue原型上挂,以便组件里获取数据。
两个文件各自引入axios,是否消耗更大的内存?
能否共用同一个axious?有啥建议方式。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
975 views
Welcome To Ask or Share your Answers For Others

1 Answer

是同一个,试试就知道了。
模块引入时,如果之前该模块已经加载过,则不会重新执行模块代码,直接取值即可。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...