一、字符串形式的 ref
<input type="text" /*给标签打上标记 ipt */ ref="ipt" />
拿到标记的节点,对其进行操作
handleClick = () => {
console.log(this);
// 用 ref 标记了的标签,都会保存在 refs 里面
console.log(this.refs); // 获取 refs
console.log
一、字符串形式的 ref
<input type="text" /*给标签打上标记 ipt */ ref="ipt" />
拿到标记的节点,对其进行操作
handleClick = () => {
console.log(this);
// 用 ref 标记了的标签,都会保存在 refs 里面
console.log(this.refs); // 获取 refs
console.log