mirror of
https://gitee.com/dromara/go-view.git
synced 2025-05-02 06:16:36 +08:00
20 lines
458 B
TypeScript
20 lines
458 B
TypeScript
import { PublicConfigType } from '@/packages/index.d'
|
|
type AttrType = Pick<PublicConfigType, 'attr'>['attr']
|
|
|
|
export const useComponentStyle = (attr: AttrType, index: number) => {
|
|
const componentStyle = {
|
|
zIndex: index + 1,
|
|
left: `${attr.x}px`,
|
|
top: `${attr.y}px`
|
|
}
|
|
return componentStyle
|
|
}
|
|
|
|
export const useSizeStyle = (attr: AttrType) => {
|
|
const sizeStyle = {
|
|
width: `${attr.w}px`,
|
|
height: `${attr.h}px`
|
|
}
|
|
return sizeStyle
|
|
}
|