Vue regard, the data acquisition method parent components of the subassembly (subassembly component function calls the parent) in

1. call parent component sub-assembly, a subassembly pass method at the call

:on-update="updateData"
 
2. subassembly props, the method receives this declaration, and
props: {
 onUpdate: Function
}
 
3. sub-components, the need to notify the parent component, onUpdate call this method, passing in the parameter data
this.opUpdate(data)
 
4. The parent component by updataData method, the acquired Data subassembly pass over, and made to operate
updateData (data) {
 // can be used here subassembly data transmission over the data
 // You can also put the parent component sub-assembly method you need to call
}

Guess you like

Origin www.cnblogs.com/jane2160/p/11590776.html