[Vuejs]-Binding on framework vue

1👍

Your vue instance is not connected to your element.

    <script>
            new Vue({
                el: '#root',
                data: {
                    message: 'Hello World!'
                }
            });
    </script>
👤ghost

3👍

el key should be on the object passed to the Vue constructor and not inside data object (Reference)

new Vue({
  el: '#root',
  data: {
    message: ''
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="root">
  <input v-model="message" placeholder="Msg">
  <p>Message you typed is: {{message}}</p>
</div>
👤adiga

2👍

new Vue({
    data: {
        el: '#root',
        message: ''
 }
});

should replace to

new Vue({
    el: '#root',
    data: {
        message: ''
    }
});

Leave a comment