How to call function on child component on parent events

Context In Vue 2.0 the documentation and others clearly indicate that communication from parent to child happens via props. Question How does a parent tell its child an event has happened via props? Should I just watch a prop called event? That doesn’t feel right, nor do alternatives ($emit/$on is for child to parent, and … Read more

Vue 2 – Mutating props vue-warn

I started https://laracasts.com/series/learning-vue-step-by-step series. I stopped on the lesson Vue, Laravel, and AJAX with this error: vue.js:2574 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “list” (found in component ) … Read more

Can I pass parameters in computed properties in Vue.Js

is this possible to pass parameter in computed properties in Vue.Js. I can see when having getters/setter using computed, they can take a parameter and assign it to a variable. like here from documentation: // … computed: { fullName: { // getter get: function () { return this.firstName + ‘ ‘ + this.lastName }, // … Read more

How to listen for ‘props’ changes

In the VueJs 2.0 docs I can’t find any hooks that would listen on props changes. Does VueJs have such hooks like onPropsUpdated() or similar? Update As @wostex suggested, I tried to watch my property but nothing changed. Then I realized that I’ve got a special case: <template> <child :my-prop=”myProp”></child> </template> <script> export default { … Read more