我还不清楚这两种语法之间的区别是什么,谢谢
@Input()
将没有任何别名命名。
例
@Input() student:any[];
<component [student]="...">
@Input('someValue')
将别名作为someValue
例
@Input('studentInfo') student:any[];
<component [studentInfo]="...">
使用别名时的说明确保您在HTML模板中使用别名。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句