【问题标题】:Getting a error when trying to delete a column from my database using Vue Client尝试使用 Vue 客户端从我的数据库中删除列时出错
【发布时间】:2019-06-02 11:58:56
【问题描述】:

我正在构建一个 Node.js PostgresSQL 服务器,从中获取我的数据,然后我想在我的 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>

【问题讨论】:

    标签: javascript node.js postgresql vue.js axios


    【解决方案1】:

    通过粘贴链接

    您的意思是将链接粘贴到浏览器中吗?如果是,那么您使用了错误的 HTTP 方法,请将其更改为 GET。

    method: "get"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-09
      • 2013-04-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多