第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Laravel CRUD Axios Vue

Laravel CRUD Axios Vue

慕容3067478 2023-09-21 10:07:46
我在 Vue/Laravel 中創(chuàng)建我的第一個 CRUD,現(xiàn)在我嘗試將創(chuàng)建發(fā)送到我的后端應(yīng)用程序,這是我的代碼:前端:async addDespesa() {  let uri = "api/despesas/create";  const response = await axios.get(uri, this.despesa).then((response) => {    this.$router.push({ name: "despesas" });  });},后端:public function create(){    //}在瀏覽器上檢查時出錯:>[vue-router] Route with name 'despesas' does not exist >Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/".    at createRouterError at createNavigationDuplicatedErrorat HashHistory.confirmTransitionat HashHistory.transitionToat evalat HashHistory.pushat new Promise at VueRouter.pushat eval
查看完整描述

1 回答

?
慕田峪7331174

TA貢獻1828條經(jīng)驗 獲得超13個贊

您的后端看起來不錯,問題出在.then您的 Axios 調(diào)用部分:


this.$router.push({ name: "despesas" });

您應(yīng)該檢查您的前端路由(可能在名為 的文件中routes.js)并確保您有一個名為 的路由despesas。所以像這樣:


let routes = [

    {

        'path': '/path/to/despesas',

        'name': 'despesas',

        component: require('./path/to/despesas-component').default

    },

    

    ...


    other routes

];


查看完整回答
反對 回復(fù) 2023-09-21
  • 1 回答
  • 0 關(guān)注
  • 96 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號