vue使用qs处理提交的表单数据首先安装qsnpminstallqs/cnpminstallqs(安装淘宝镜像后)qsglobalimport//在main.js中引入qsimportqsfrom'qs'//通过全局属性配置,可以在任意组件中使用this.$qs获取qs对象Vue.prototype.$qs=qsuseqsletpostData=qs.stringify({id:84})this.axios.post('/api/news/singel.php',postData).then((res)=>{console.log(res);}).catch((err)=>{console.log(err,'error')})
