Home > @jview/hooks > useElementContentRect
useElementContentRect() function
封装了计算 dom ContentRect 的 hook
Signature:
typescript
export declare function useElementContentRect(options: Partial<UseElementContentRectOption>): {
rectData: {
width: number;
height: number;
x: number;
y: number;
top: number;
right: number;
bottom: number;
left: number;
};
calc: () => void;
};
export declare function useElementContentRect(options: Partial<UseElementContentRectOption>): {
rectData: {
width: number;
height: number;
x: number;
y: number;
top: number;
right: number;
bottom: number;
left: number;
};
calc: () => void;
};
Parameters
Parameter | Type | Description |
---|---|---|
options | Partial<UseElementContentRectOption> | UseElementContentRectOption |
Returns:
{ rectData: { width: number; height: number; x: number; y: number; top: number; right: number; bottom: number; left: number; }; calc: () => void; }
rectData(rect 数据), calc(计算触发方法)