API 参考ui 模块clear 清除所有子元素本页总览clear 清除所有子元素clear 类型: MethodDeclaration 所属类: UIElement 定义位置: ui.ts 描述 清除所有子元素 返回值:当前元素 返回值 类型: this 当前元素 源代码 位置: 第 1341 行 public clear(): this { const {children} = this let i = children.length while (--i >= 0) { children[i]?.destroy() } return this } 文档生成时间:2025/7/7 12:07:07