摘要: 1. 被更新时触发 componentDidUpdate(prevProps, prevState){ const typrval = this.props.typrval; if (typrval prevProps.typrval) { return } (需要执行的函数) }2. 基本顺序 c 阅读全文
posted @ 2018-01-16 18:35 大耳朵小虎 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1. document.activeElement.blur(); 苹果下会出现一个完成的tab,去掉方法如下: <input id="job" onfocus="this.blur()"> 输入框添加:onfocus="this.blur()" 阅读全文
posted @ 2018-01-16 18:32 大耳朵小虎 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1. 父组件如何获取子组件的方法以及属性? 1.)父组件: render( ){ console.log( this.refs.getmethod ); return ( <div> <children ref="getmethod" /> </div> ) } 2.)子组件: 属性 方法 阅读全文
posted @ 2018-01-16 15:12 大耳朵小虎 阅读(97) 评论(0) 推荐(0) 编辑