this.$ajax({method:'delete',url:'/api/commodityCategory/delete',data:{"id":"a"},}).then(function(response){console.log(response);}).catch(function(response){console.log(response);});这样写好像毫无反应,也没有回报.看文档貌似也没有例子this.$ajax在vue的main.js配置过了
2 回答
杨__羊羊
TA贡献1943条经验 获得超7个赞
axios.delete({url:'/api/commodityCategory/delete',data:{"id":"a"}}).then(function(response){console.log(response);}).catch(function(response){console.log(response);});或者:axios({method:'delete',url:'/api/commodityCategory/delete',data:{"id":"a"}}).then(function(response){console.log(response);}).catch(function(response){console.log(response);});
森栏
TA贡献1810条经验 获得超5个赞
axios说实话我没见过你所写的methods这个属性delete应该是axios的一个方法你应该axios.delete(url).then(res=>{})这种格式
添加回答
举报
0/150
提交
取消