小程序监听数组长度是否为0

小程序动态监听选中checkbox的集合是否为空,

Array.isArray(this.state.checkedList) && this.state.checkedList.length === 0 ? "数组长度不为0":"数组长度为0"
案例如下:
在Taro 中的写法:
<View className={(Array.isArray(this.state.checkedList) && this.state.checkedList.length === 0 )|| this.state.textAreaCon.length == 0   ? 'findOpcityBtn' :'findBtn'} >
  <AtButton className='atbutton' onClick={this.handleSubmit}>提交评价</AtButton>
</View>
原文地址:https://www.cnblogs.com/lvxisha/p/12803104.html