我在 Vue/Laravel 中创建我的第一个 CRUD,现在我尝试将创建发送到我的后端应用程序,这是我的代码:
前端:
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 createNavigationDuplicatedError
at HashHistory.confirmTransition
at HashHistory.transitionTo
at eval
at HashHistory.push
at new Promise
at VueRouter.push
at eval
慕田峪7331174
相关分类