I'm collecting questions from my database. I post these questions with v-for. I also create an input for users to answer these questions.
<el-form v-model="answer" class="form-bilan" label-position="top">
<el-form-item label="test" :label="question.question_without_html"
class="form-bilan__label-input"
:for="'question_' + question.id"
:key="question.id"
v-for="question in questions.questions"
v-if="question.type == 'label-input'">
<el-input :id="'question_' + question.id"></el-input>
</el-form-item>
<div style="clear: both;"></div>
</el-form>
I would like to link these input (answers) to an object in data() to be able to send them with axios on my server
Do you have an idea of how?
data() {
return {
answer: {
},
}
}
Thanks !