争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

如何封装一个React Native多级联动(代码完成)

时间:2024/6/1作者:未知来源:争怎路由网人气:

[] // 当前选择的是每一级的每一项,如[1, 0],第一级的第2项,第二级的第一项 } this.close = this.close.bind(this) // 指定this this.ok = this.ok.bind(this) // 指定this } close () { // 取消按钮事件 this.props.onClose && this.props.onClose() } ok () { // 确认按钮事件 this.props.onOk && this.props.onOk(this.state.indexs) } onChange (itemIndex, currentIndex) { // itemIndex选中的是第几项,currentIndex第几级发生了变化 const indexArr = [] const { options = [], indexs = [] } = this.state const re = (arr, index) => { // index为第几层,循环每一级 if (arr && arr.length > 0) { let childIndex if (index < currentIndex) { // 当前级小于发生变化的层级, 选中项还是之前的项 childIndex = indexs[index]

关键词:如何封装一个React Native多级联动(代码完成)




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版