component:
<input name="search" onChange={this.onChange}>
console.log(component.find('div').at(0).childAt(0).find('input').find('search').debug())
错误:
不显示任何内容
您可以通过指定组件的属性来找到它们,这些属性称为对象属性选择器。请查找详细信息here。
正如您所说的,您想使用name
属性来查找组件,然后请尝试以下操作:
component.find({ name: "search" }).debug();