0👍
Instead of :selected
you need to use v-model
on your select like this.
<div class="col-md-2">
<label>Time</label>
<div id="app-time">
<select name="time" class="form-control" v-model="selectedValue">
<option value="0">--Please Select--</option>
<option v-for="time in times" :value="time.value">
@{{ time.text }}
</option>
</select>
</div>
</div>
You can read more about it here
- [Vuejs]-Vue two array loop in one ul
- [Vuejs]-How to make multiselect work in sails.js using built in vue and ajax forms?
0👍
Don’t use json_encode method with double quoted string within interpolation, because it will generate string with enclosing in double quote.
echo json_encode('12:00 AM'); //"12:00 AM"
Use interpolation with single quote
<option v-for="time in times"
v-bind:value="time.value"
:selected="time.value == '{{$getDeliveryReceipt['time']}}'"
>{{time.text}}</option>
Source:stackexchange.com