qs vue in using object serialization ---

1, Downloads:

  • above sea level and qs 

2, the introduction:

  • import qs from 'qs'

3, qs There are two main methods:

Method a: The object serialization, with & splicing (splicing process is from the bottom, no manual operation) among the plurality of objects

qs.stringify () is converted into the query string 
the let = {Content Comments: this.inputValue} 
the let comValue = qs.stringify (Comments)

Method 2: the sequence of the contents of split into one single object

qs.parse () is converted into an object json 
let comValue = qs.parse (comments)

4.qs usage of axios

 

 

Guess you like

Origin www.cnblogs.com/yxkNotes/p/11583739.html