0
In a simple test in Vue.Js, following the example of documentation, span never displays the data selected by select.
select is mounted by Vue, but the variable select
is not mirror.
<div class="row" id='vue'>
<select v-model="selected">
<option v-for="option in options" v-bind:value="option.value">
@{{ option.text }}
</option>
</select>
<span>Selected: @{{ selected }}</span>
</div>
<script>
new Vue({
el: '#vue',
data: {
selected: 'A',
options: [{
text: 'One',
value: 'A'
},
{
text: 'Two',
value: 'B'
},
{
text: 'Three',
value: 'C'
}
]
}
})
</script>
I’m using @{{
because it is an implementation in Laravel.