Vuejs explains the instance of GET and POST using the AXIOS asynchronous access.

Script.

Let Data = {….}; Let URL = XX;
   
Different:

THIS. $ Ajax.get (URL, {params: Data}). “Function (RES) {console.log (res. c)}) .catch (ire) {console.log (error)})

POST:
   
/ / Requests the back-end data before converting the parameters = XX; let Data = {UNAME: this.uname, upwd: this.upwd, pid: this.pid}; function transformrequest (data) {let ket = ‘FOR (LET ITICODEURICIMPONENT (IT) ) + ‘=’ + encodeuricomponent (DATA [IT]) + ‘&’} Return Ret} Let P = TransformRequest (data) This. $ Ajax.Post (URL, P) .Then (Function (RES) {Console.log (res. {console.log (error)})

Method 2: 2

VAR QS = Require (‘QS’);
   

$ Ajax.get (URL, QS.Stringfy (Data)) .Then (Function (RES) {Console.log (res. {console.log (error)})

THIS. $ AJAX is to inject AXIOS to rename it by modifying the VUE prototype, or AXIOS.
The above Vuejs uses the AXIOS asynchronous access to the instance of GET and POST is the full content of Xiaobian sharing to everyone, I hope I can give you a reference, I also hope that everyone will support Tumi Cloud.
                     
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment