0👍
✅
Take a look at two-way binding: http://vuejs.org/guide/components.html#Prop_Binding_Types
This allows you to sync a property’s value in both directions, meaning the parent or the child has access to change the variable. Then you can watch for changes on the parent and update accordingly.
I think a better option would be to create a RadioSet component, which then would house a number of radio buttons. This would eliminate your concern about a parent having to have the activate()
method. You could simply pass in an object with a series of id
and values
that could be used to generate the buttons.
👤Jeff
Source:stackexchange.com