# uni-data-picker ## Instructions 组件名:uni-data-picker 代码块: uDataPicker 关联组件: uni-data-pickerview 、 uni-load-more 。 点击下载&安装 ### Syntax - 使用 ``(或 ``,当需要包裹子节点时)。 - 遇到平台差异时,建议使用条件编译(`#ifdef / #endif`)显式处理。 #### Properties | 属性名 | 类型 | 可选值 | 默认值 | 说明 | | --- | --- | --- | --- | --- | | v-model | String/ Number | - | - | 绑定数据 | | spaceInfo | Object | - | - | 服务空间配置, 详情 | | localdata | Array | - | - | 数据, 详情 | | preload | Boolean | true/false | false | 预加载数据 | | readonly | Boolean | true/false | false | 是否禁用 | | clear-icon | Boolean | true/false | true | 是否显示清除按钮 | | ellipsis | Boolean | true/false | true | 是否隐藏 tab 标签过长的文本 | | step-searh | Boolean | true/false | true | 分步查询时,点击节点请求数据 | | self-field | String | - | - | 分步查询时当前字段名称 | | parent-field | String | - | - | 分步查询时父字段名称 | | collection | String | - | - | 表名。支持输入多个表名,用 , 分割 | | field | String | - | - | 查询字段,多个字段用 , 分割 | | where | String | - | - | 查询条件,内容较多,另见jql文档: 详情 | | orderby | String | - | - | 排序字段及正序倒叙设置 | | popup-title | String | | | 弹出层标题 | | map | Object | - | {text:'text',value:'value'} | 字段映射,将text/value映射到数据中的其他字段 | #### Events | 事件称名 | 类型 | 说明 | | --- | --- | --- | | @change | EventHandle | 选择完成时触发 {detail: {value}} | | @nodeclick | EventHandle | 节点被点击时触发 | | @popupopened | EventHandle | 弹出层弹出时触发 | | @popupclosed | EventHandle | 弹出层关闭时触发 | #### Platform Compatibility See official docs for platform support table: `https://uniapp.dcloud.net.cn/component/uniui/uni-data-picker.html` ### Examples ### Example (Example 1) ```vue ``` ### Example (Example 2) ```vue ``` ### Example (Example 3) ```vue ``` ### Example (Example 4) ```vue ``` ### Example (Example 5) ```vue {{error}} {{item.text}} 请选择 ``` ### Example (Example 6) ```html {{error}} {{item.text}} 请选择 ``` Reference: - [Official Documentation](https://uniapp.dcloud.net.cn/component/uniui/uni-data-picker.html) - [Plugin Marketplace](https://ext.dcloud.net.cn/plugin?name=data-picker) - [Local Example](examples/uni-ui/uni-data-picker.vue)