vue neutron component updates parent component

When a change in some of the information in the sub-assembly and sub-assembly is closed, the parent needs to modify the contents of the updated components, how to operate

1, $ emit trigger

  Parent component @ add = "add (val)"

  Subassembly  the this. $ EMIT ( 'the Add', newVal)

2, $ parent trigger

  Component parent update data is triggered by a method, such as the getList ()

  Subcomponents this. $ Parent.getList ()

 

A few days do not forget to record faster, and quickly write down

  

Guess you like

Origin www.cnblogs.com/evanc/p/11283419.html