使用get能夠請求到資料,但是使用post無法請求,請大神解救:
代碼如下:
add(){
this.$http.post('./static/new_file-json.json',{name: this.name},{emulateJSON: true}).then(result=>{
if(result.status === 0){
this.getAllList()
}else{
alert('添加失敗')
}
})
}
報錯 :
uj5u.com熱心網友回復:
json檔案是靜態檔案不支持post請求轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/98466.html
標籤:JavaScript
下一篇:js靜態分頁 動態修改標題
