更新记录
0.0.3(2024-07-08) 下载此版本
更新了文档
0.0.2(2024-07-05) 下载此版本
优化了文档
0.0.1(2024-07-05) 下载此版本
首次更新,支持带搜索的树形选择器(通过深度递归算法实现)
查看更多平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | - | - | - | √ | - | - | - |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
× | × | √ |
带搜索功能的树形插件
可以设置keyLabel和keyValue(目前默认是name和id)
设置localdata的树形数据([{},{}]格式)
以下为使用demo:(源码文件里demo.vue也是示例代码)
<sediao-tree-picker ref="picker_category" @change="(e)=>{PickCategory(dto,e)}" key-label="name"
key-value="id" :filter="true" :localdata="columns_categorys">
<view class="flex">
<view>{{dto.categoryStr||dto.category || '请选择'}}</view>
<uni-icons class="m-l-a" type="right"></uni-icons>
</view>
</sediao-tree-picker>
async PickCategory(item, e) {
console.log('PickCategory', item, e)
if (e.detail.value) {
var currentnode = e.detail.value[e.detail.value.length - 1]
let tmpe = e
this.dto.categoryStr = currentnode.name
this.dto.category = currentnode.id
}
},
columns_categorys: [{
name: 'A',
id: 'A',
children: [{
name: 'A-1',
id: 'A-1',
}, {
name: 'A-2',
id: 'A-2',
}]
},
{
name: 'B',
id: 'B',
children: [{
name: 'B-1',
id: 'B-1',
}, {
name: 'B-2',
id: 'B-2',
}]
},
{
name: 'C',
id: 'C',
},
]