mostafalaravel
1 month ago

How to select a specific option from a method

Posted 1 month ago by mostafalaravel

Hello ,

How to select option from this method ? let's say the type Id : 5;

getCurrentTask(taskId) {
                axios.get(`/api/tasks/` + taskId)
                    .then(response => {
                        this.currentTask = response.data;
                        this.taskId = taskId;
            let typeId = 5;
                       /*


                Here I would like to make the option Id '5 selected 

            */
                    });
            },
<select class="form-control" id="inputTaskType" v-model="newTask.taskTypeId">
                    <option :value="type.id" v-for="type in taskTypesList">
                        {{type.name}}
                    </option>
                </select>

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