mlutz
123
2
Vue

Form with array - problem with select options

Posted 8 months ago by mlutz

Hello, i need a form to edit some data. From the Api I receive the following data

[{"id":1,"firstname":"Emma","lastname":"Gomez","tdate":"2018-03-03","visit":"X"},{"id":2,"firstname":"Jacob","lastname":"Miller","tdate":"2018-03-03","visit":"D"}...

I would like to list the data and change the visit-state.

 <ul v-if="players">
            <li v-for="{ id, firstname, lastname } in players">
            {{ firstname }} {{ lastname }} 
                <select>
                <option value="X">Present</option>
                <option value="E">Excuse</option>
                <option value="D">Diseased</option>
                </select>
          </li>
        </ul>

My first problem: How can i list the received data? The players are displayed. But the old Value is not selected and in the second step i want to save the changes to the api. Thanks for help.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.