更新记录
1.0(2022-09-30) 下载此版本
更新节点展开的优化
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | - | √ | √ | - | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
1.数据结构是 [ [ { id:1,title:'第一节课',children:[ { id:2,title:'第一一章' } ] } ] ]
2.defaultProps是配置节点数据
defaultProps: { id: 'id', children: 'children', label: 'title' }
3.组件中的 item.selshow 这个参数是我自己遍历了树加的对象 ,作用是用于树形结构的展开
data是树形结构
示例: mapTree(data) {
for (let index = 0; index < data.length; index++) {
data[index].forEach((items, index) => {
//遍历树 拼入相应的disabled
items['selshow'] = false;
// console.log(items, '树');
if (items.children) {
// console.log(items.children,'树AA');
let childarr = [items.children]
this.mapTree(childarr);
}
});
}
},