[Vuejs]-Cannot change app.message = 'something' in console

0👍

Your problem is that coffeescript is scoping your app variable inside the $(document).ready function. Try this.

$(document).ready ->
  window.app = new Vue(
    el: '#app'
    data: {message: 'Hello Vue!'})
  window.app2 = new Vue(
    el: '#app2'
    data: message: 'You loaded this page on ' + new Date)
  window.app3 = new Vue(
    el: '#app3'
    data: seen: true)

Example.

👤Bert

Leave a comment