我的vuejs应用程序步骤功能在提交之前停止



我有一个包含3个步骤的步骤表单,它在提交前的第三步停止。调试时发现方法不允许出现异常。我的代码如下

if(this.step == 39){
console.log(this.readinessAssessment); 
console.log(this.jobSeekerId);  
this.showLoader = false;
axios.post('/save-competencies', {readinessAssessment: this.readinessAssessment, jobSeekerId: this.jobSeekerId})
.then(response => {
console.log(response);
if(response.data.success){
this.competenciesPart = false;
this.applicationAccepted = true;
setTimeout(() => {
this.step = 100;
}, 1000);
this.hideProgressBar = false;
this.hideProcess = false;
}
this.showLoader = false;
}).catch(error => {
this.showLoader = false;
console.log(error);
});
}

我的路线是

Route::post('/save-competencies', [FrontendController::class, 'saveCompetencies'])->name('saveCompetencies');

您在评论中提到的问题是:Error: On following this link saying get method is not supported for this route. Methos allowed is post

这个问题的解决方案是。

Laravel项目中运行这两个命令

php手工优化:清除

composer dump:自动加载

这将修复路由方法类型问题。

最新更新