For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/components/view-container/view.md.

view

基础布局容器,用于组织和嵌套其他组件,支持 Flexbox 布局。

扫码预览

扫码预览 view

Props

属性名类型默认值必填说明
childrenReactNode-否子元素
classNamestring-否组件类名
flattenbooleantrue否是否扁平化元素,避免创建真实渲染对象以提升性能
idstring-否元素的唯一标识
keystring | number | null-否React key 属性
onAppear(event: UIAppearanceEvent) => void-否元素曝光时的回调函数(进入可视区域)
onCatchTap(event: TouchEvent) => void-否点击时的回调函数(阻止事件冒泡)
onClick(event: TouchEvent) => void-否点击时的回调函数
onDisappear(event: UIAppearanceEvent) => void-否元素消失时的回调函数(离开可视区域)
onLayoutChange(event: LayoutChangeEvent) => void-否布局变化时的回调函数
onLongPress(event: TouchEvent) => void-否长按时的回调函数
onTouchEnd(event: TouchEvent) => void-否触摸结束时的回调函数
onTouchMove(event: TouchEvent) => void-否触摸移动时的回调函数
onTouchStart(event: TouchEvent) => void-否触摸开始时的回调函数
refRef<NodesRef>-否用于获取组件实例的 ref
styleCSSProperties-否组件样式