Angular 里 父组件调用子组件方法很简单,打个标签就可以直接用
<ng-container> <a (click)="child.sayHi()">click</a> <app-children #child> <p>children?text</p> </app-children> </ng-container>
但是 react 就需要用 createRef(), 所以我想知道,有没有什么别的方式??
2.1m questions
2.1m answers
63 comments
56.6k users