LayoutEvent 对象类型
LayoutEvent 对象会在组件布局变化后作为回调结果返回,例如 View 组件中的 onLayout。
示例
JavaScript
{
layout: {
width: 520,
height: 70.5,
x: 0,
y: 42.5
},
target: 1127
}
键和值
height
布局变化后组件的高度。
| Type | Optional |
|---|---|
| number | No |
width
布局变化后组件的宽度。
| Type | Optional |
|---|---|
| number | No |
x
组件在父组件内的 X 坐标。
| Type | Optional |
|---|---|
| number | No |
y
组件在父组件内的 Y 坐标。
| Type | Optional |
|---|---|
| number | No |
target
接收 LayoutEvent 的元素节点 id。
| Type | Optional |
|---|---|
number, null, undefined | No |