react map循环的dom,点击让当前数组里的isShow显示false

    changeTitle = (data, index) => {
        const { bottomOrgList } = this.state
        const newList = bottomOrgList.map((v, i) => {
            const newV = {
                ...v,
                isShow: i === index ? false : true
            }
            return newV
        })
       
        
        this.setState({
            flagValue: data.orgName,
            editTitle: data.orgName,
            bottomOrgList: newList
        })
        
       
    }
posted @ 2019-12-19 14:52  Webwhl  阅读(487)  评论(0编辑  收藏  举报