mand-mobile
mand-mobile copied to clipboard
[feature-request] 希望 picker 多级选择器数据源能自定义键值
What problem does this feature solve?
数据源里面 text label 或者 value 可以自定义为别的变量名
What does the proposed API look like?
类似 https://element.eleme.io/#/zh-CN/component/cascader 里的 Props
是什么样的使用场景?
数据源格式与 picker 要求数据源格式不一致的时候。
[
[
{
// 选项展示文案
"text": "",
// 以下自定义字段
"value": ""
},
// ...
],
// ...
]
而实际用的数据源格式为
[
[
{
// 选项展示文案
"listtext": "",
// 以下自定义字段
"listvalue": ""
},
// ...
],
// ...
]
Element cascader 组件就可以指定选项的值为选项对象的某个属性值
label: 'listtext',
value: 'listvalue'
数据手动格式化一下就好了,这需求似乎不是很有必要。