大家好,又见面了,我是你们的朋友全栈君。
1.新建子组件
app-child
2.在父组件中引用子组件
<app-child [value1]=”fatherValue”></app-child>
2.在子组件中使用@Input接受父组件传的值
@Input()
value1: string;
value1就是父组件传到子组件的值了,可以在子组件中去使用
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/134965.html原文链接:https://javaforall.net