var ProductionStyleBox=React.createClass({ handClick: function(){ console.log(arr) }, render : function(){ var arr=[]; return ( <li onClick={this.handClick}> <ProductionStyle1 /> </li> ) } })
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
handClick()与render()本身是两个独立的函数,作用域也是独立的.所以访问不到是正常的