【问题标题】:My vuejs applications step function stops just before submit我的 vuejs 应用程序步骤功能在提交之前停止
【发布时间】:2022-01-13 08:10:32
【问题描述】:

我有一个包含 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');

【问题讨论】:

  • 请正确提及错误以及您的期望?
  • 在步骤表单中的最后一个单选按钮之后单击提交时卡住了这是人们回答和提交的问题。在控制台中检查时显示 500。
  • 在点击此链接时说此路线不支持 get 方法。允许的方法是张贴
  • 我的数据是一个18个元素的数组
  • Array(18) 0: {question: 'some question', answer: 'Occasional', weightedScore: '0.5', 能力: '适应性'} 1: {question: 'Isome question',答案:'偶尔',weightedScore:'0.5',能力:'适应性'} 2:{问题:'一些问题',答案:'否',weightedScore:'0.25',能力:'协作'} ....

标签: laravel vue.js


【解决方案1】:

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

这个问题的解决办法是。

在你的 Laravel 项目中运行这两个命令

php 工匠优化:清除

作曲家转储:自动加载

这将解决路由方法类型问题。

【讨论】:

  • 谢谢。这解决了这个问题。现在一切正常
  • @Mrs.Mani 谢谢,这是我的荣幸
猜你喜欢
  • 2016-04-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-22
  • 2019-10-27
  • 2014-07-05
  • 1970-01-01
相关资源
最近更新 更多