v-model does not work in vuejs

0

In a simple test in Vue.Js, following the documentation example, span never displays the data selected by select.

The select is set by vue, but the variable select is not mirrored.

    <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's an implementation in Laravel.

    
asked by anonymous 26.09.2018 / 16:56

1 answer

1

I have found that this is some conflict with JQMigrate and is only locking the selects, there is nothing to do with the vues.

To figure this out, I tested v-mode on another element and it worked, just like if I remove JQMigrate, the select itself works normally.

I have not solved the conflict yet, but as the question is about the vues, I will consider it resolved and leave here to facilitate the life of the next.

On the console, there is this alert:

    
26.09.2018 / 17:16