File tree Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,48 @@ export function removeEmptyValues(obj: any, exclude?: excludeOptions) {
169
169
}
170
170
171
171
/**
172
- * Remove tree data that matches the specified value
172
+ * Remove ` tree data` that matches the specified value
173
173
* 去除树状数据中指定的数据
174
174
*
175
+ * @category Base
175
176
* @param treeData 树状数据
176
177
* @param matchFunction 匹配函数
177
- * @returns 去除后的树状数据
178
+ * @returns Array 处理好的值
179
+ * @example
180
+ * ```
181
+ *const treeData = [
182
+ * {
183
+ * id: 1,
184
+ * name: "A",
185
+ * children: [
186
+ * {
187
+ * id: 2,
188
+ * name: "B",
189
+ * children: [
190
+ * {
191
+ * id: 3,
192
+ * name: "C",
193
+ * children: [],
194
+ * },
195
+ * ],
196
+ * },
197
+ * {
198
+ * id: 4,
199
+ * name: "D",
200
+ * children: [],
201
+ * },
202
+ * ],
203
+ * },
204
+ * {
205
+ * id: 5,
206
+ * name: "E",
207
+ * children: [],
208
+ * },
209
+ *];
210
+ *const matchFunction = (item:any) => item.id === 3;
211
+ *const newTreeData = removeTreeData(treeData, matchFunction);
212
+ *
213
+ * ```
178
214
*/
179
215
export function removeTreeData (
180
216
treeData : any [ ] ,
You can’t perform that action at this time.
0 commit comments