<meta charset="utf-8">
parse
将url
的参数转化为object
对象
例如:a=5&b=6
=> { a:5,b:6 }
const str = "name='hana'&age='18'"
console.log(qs.parse(str)) // logs Object { name: "'hana'", age: "'18'" }
stringify
将对象转为url参数格式
console.log(qs.stringify({
name:'hana',
age:'18'
}))
// logs name=hana&age=18
网友评论