antd treeSelect 树形选择器 treeData 使用simpleMode无效?

antd treeSelect 树形选择器 treeData
使用类似于 treeData: [{"id":1,"pId":0,"title":"企业身份","value":"1","key": 1}]这种形式
也在TreeSelect标签中设置了treeDataSimpleMode为true,但是没有显示?!
图片描述

请问这边有什么问题吗?可以贴个例子吗?

阅读 11.8k
1 个回答

const simpleTreeData = [

{ id: 1, pId: '', value: '1', title: "test1" },
{ id: 2, pId: 1, value: '2', title: "test2" },
{ id: 3, pId: 1, value: '3', title: "test3" },
{ id: 4, pId: 1, value: '4', title: "test4" },

]

const tProps = {

treeData: simpleTreeData,
value: this.state.value,
onChange: this.onChange,
treeCheckable: true,
showCheckedStrategy: SHOW_PARENT,
searchPlaceholder: 'Please select',
style: {
    width: 300,
},
treeDataSimpleMode: simpleTreeData

};

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题