Rainier laan
Rainier laan

Reputation: 1130

Laravel VueJS keep getting errors with vueJS

I keep getting errors when I try to do simple things. It works perfectly but it just says Method definition shorthands are not supported by current JavaScript version. I just don't get it, I never had this problem before.

enter image description here

Thanks in advance

Upvotes: 1

Views: 98

Answers (1)

Bert
Bert

Reputation: 82449

The syntax,

methods: {
   addMessage(message){
     this.messages.push(message)
   }
}

Is the newer Ecmascript method shorthand syntax. It sounds like your editor doesn't like it for some reason. You can use the old school syntax.

methods: {
   addMessage: function (message){
     this.messages.push(message)
   }
}

It looks like you can set the javascript version as a setting.

Upvotes: 1

Related Questions