mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 位置处理提取
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
interface AttrType {
|
||||
x: number
|
||||
y: number
|
||||
w: number
|
||||
h: number
|
||||
}
|
||||
|
||||
export const useComponentStyle = (attr: AttrType, index: number) => {
|
||||
const componentStyle = {
|
||||
zIndex: index,
|
||||
left: `${attr.x}px`,
|
||||
top: `${attr.y}px`,
|
||||
width: `${attr.w}px`,
|
||||
height: `${attr.h}px`
|
||||
}
|
||||
return componentStyle
|
||||
}
|
||||
Reference in New Issue
Block a user