Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jun 11, 2023
1 parent 5746663 commit 468a6dc
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 72 deletions.
Binary file removed docs/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion docs/index.html

This file was deleted.

Binary file removed docs/logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion docs/static/css/app.4f943f9a.css

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/css/chunk-vendors.42851454.css

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/js/app.b6ee3c8e.js

This file was deleted.

12 changes: 0 additions & 12 deletions docs/static/js/chunk-vendors.81bac7f4.js

This file was deleted.

112 changes: 56 additions & 56 deletions src/views/API.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2164,62 +2164,62 @@ export default {
`
]
},
{
name: 'filterTree',
args: 'obj, iterate[, options, context]',
title: '从树结构中根据回调过滤数据',
desc: '',
params: [
['属性', '描述', '默认值'],
['children', '子节点属性', 'children']
],
codes: [
`
var tree1 = [
{ id: 1 },
{
id: 2,
children: [
{ id: 20 }
]
},
{
id: 3,
children: [
{ id: 30 }
]
}
]
XEUtils.filterTree(tree1, item => item.id === 1)
// { id: 1 }
// {
// name: 'filterTree',
// args: 'obj, iterate[, options, context]',
// title: '从树结构中根据回调过滤数据并生成新的 children 属性',
// desc: '',
// params: [
// ['属性', '描述', '默认值'],
// ['children', '子节点属性', 'children']
// ],
// codes: [
// `
// var tree1 = [
// { id: 1 },
// {
// id: 2,
// children: [
// { id: 20 }
// ]
// },
// {
// id: 3,
// children: [
// { id: 30 }
// ]
// }
// ]
// XEUtils.filterTree(tree1, item => item.id === 1)
// // { id: 1 }
var tree2 = [
{ id: 1 },
{
id: 2,
childs: [
{ id: 20 }
]
},
{
id: 3,
childs: [
{ id: 30 }
]
}
]
XEUtils.filterTree(tree2, item => item.id >= 3, {children: 'childs'})
// [
// {
// id: 3,
// childs: [
// { id: 30 }
// ]
// }
// ]
`
]
},
// var tree2 = [
// { id: 1 },
// {
// id: 2,
// childs: [
// { id: 20 }
// ]
// },
// {
// id: 3,
// childs: [
// { id: 30 }
// ]
// }
// ]
// XEUtils.filterTree(tree2, item => item.id >= 3, {children: 'childs'})
// // [
// // {
// // id: 3,
// // childs: [
// // { id: 30 }
// // ]
// // }
// // ]
// `
// ]
// },
{
name: 'searchTree',
args: 'obj, iterate[, options, context]',
Expand All @@ -2229,7 +2229,7 @@ export default {
['属性', '描述', '默认值'],
['children', '子节点属性', 'children'],
['mapChildren', '将子节点映射到指定的属性', ''],
['original', '是否源对象地址引用(谨慎!源数据将被破坏', 'false']
['original', '是否源对象地址引用(如果为true,则创建新的对象', 'false']
],
codes: [
`
Expand Down

0 comments on commit 468a6dc

Please sign in to comment.