1

I am going through vue 2 laracast videos I am stuck in the 1st tutorial itself.

<div id="app">
  <h1>@{{ message }} </h1>
  <input type= "text" id="input" v-model = "message">
</div>

<script src="https://cdn.jsdelivr.net/npm/vue"></script>


<script >
    var data = {
        message: 'Hello Vue!'
    }
    new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!'
      }
    })
</script>

don't work, gives an error

Use of undefined constant message - assumed 'message'

@{{ message }}

gives me the result then proceeding to v-model gives an empty input box no message.

5
  • what version of laravel are you using? what version of laravel are they using in the videos? Commented Jan 1, 2018 at 8:22
  • your code is correct and iI tested it in Laravel Commented Jan 1, 2018 at 8:55
  • @lagbox I am using laravel 5.4 in tutorial they used plain html Commented Jan 1, 2018 at 14:54
  • the answer is there. Commented Jan 2, 2018 at 5:26
  • @Amin adding @ display Hello Vue! but not v-model input text Commented Jan 2, 2018 at 14:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.