axios usage of the whole solution

[Introduction]

    This article describes the next axios usage, we hope to help

 

【main body】

(1) Download

npm i axios --save

(2) introducing axios module

  Embodiment 1: In each page root component is introduced, then

  

 

  

 

   

  Embodiment 2: In the introduction of an entry file, then Vue.prototype properties, i.e. Vue prototype object is introduced to the loading register ---- Vue prototype object Vue.prototype

  

 

  

(3) axios

  Use in a timely manner

  ①get request shown below, the parameter can be spliced ​​directly to the back

  

 

   ② can also be used to store parameters params options

  

 

 

 

 

 

.

Guess you like

Origin www.cnblogs.com/jianxian/p/11938679.html