nutui-react icon indicating copy to clipboard operation
nutui-react copied to clipboard

Picker自定义省市区数据结构的key(关键词)

Open Aliujiayu opened this issue 2 years ago • 1 comments

What problem does this feature solve?(这个功能解决的问题)

现在默认为「value」,「text」有时候数据格式,并不会固定,然后还得自己循环改,比较麻烦,定义一下这个key,就没那么麻烦了

What does the proposed API look like?(期望的 API)

这样

<Picker
  listDataKey = {
    value: 'value',
    name: 'text',
    children: 'children'
  }
></Picker>

或者

<Picker
  listDataKey = {
    value: 'value',
    name: 'text',
    children: {
      {
        value: 'value',
        name: 'text',
        children: {
          {
            value: 'value',
            name: 'text'
          }
        }
      }
    }
  }
></Picker>

Aliujiayu avatar Apr 26 '23 12:04 Aliujiayu

后续在 2.0 版本中考虑实现

oasis-cloud avatar Apr 27 '23 11:04 oasis-cloud