我正在构建一个 Node.js PostgresSQL Server,从中获取我的数据,然后我想在我的 Vue 客户端中显示它们。现在我被困在从我的客户端删除列。当我尝试删除它时,出现此错误。https://imgur.com/6fiBrUc
我已经尝试通过粘贴链接http://localhost:3000/buch/del/9781201600312来测试我的路线,并且它从我的数据库中删除了该列,所以我认为该路线可以正常工作,但我的客户有问题
我的 Axios 电话:
async delSpalte(isbn){
await axios({
url:"http://localhost:3000/buch/del/" + isbn,
method: "delete"
});
}
我把我的数据放在这个表中:
<tr v-for="x in books">
<th @click="CurrClickedTitle = x.titel; getAnzahlBuecher(x.isbn)">
{{x.titel}}</th>
<td>{{x.isbn}}</td>
<td>{{x.erscheinungsdatum}}</td>
<td>{{x.preis}}</td>
<td><button @click="delSpalte(x.isbn); getBuecher();" class="btn btn-danger">Löschen</button></td>
通过粘贴链接
你的意思是你把链接粘贴到浏览器中?如果是,那么您使用了错误的 HTTP 方法,请将其更改为 GET。
method: "get"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句