Parameter passing / call between Vue assembly

Not directly invoke methods or parameter passing between the components Sons

Parent => promoter, by value (props)
using v-bind to the traditional values subassembly, the subassembly is received props used
in the process should be directly used this.yingfu, but I did not succeed

father:Parent component

child:
Here Insert Picture Description
Here Insert Picture Description

Sub => parent, traditional values ​​( e m i t in child group Matter How to law in Make use EMIT) used in the method of subassembly emit method to trigger a password parent element binding
Note html not case-sensitive password supposedly declared hideCoupon subassembly within parent components bound to html you can use hide-coupon, but did not trigger
the father:
Here Insert Picture Description
Here Insert Picture Description
son:
Here Insert Picture Description

Sub => parent, call ( r e f s refs) parent component to define a method, in which by then refs subassembly to call the corresponding methods
Parent:
Here Insert Picture Description
child:

Here Insert Picture Description

Published 11 original articles · won praise 0 · Views 132

Guess you like

Origin blog.csdn.net/baiyikai/article/details/104712825