[Vuejs]-Debugging VueJS Questionnaire – button not functioning

0👍

The problem says that you art trying to call forEach on undefined element. It points you to line 334 because there you have questionList.forEach.

Going through the Full code example, I noticed that you call onSendData on the click event, like:

 <button 
 ...
 v-on:click="onSendData(questionList)"
>

And because this is called in the template, I didn’t find something called questionlist (prop, data, computed, etc) to be actually passed as a parameter,
meaning what you are doing is similar to this:

 <button 
 ...
 v-on:click="onSendData()"
>

The reason enter works is probably because of <flow-form> and the events attached to that component.

So, instead of calling onSendData manually, you have to "force" the form submit event.

I would suggest if you do not intend to do anything special with that button, to leave the default one.

Leave a comment