mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 新增标尺
This commit is contained in:
@@ -3,6 +3,7 @@ import { PickCreateComponentType } from '@/packages/index.d'
|
||||
type AttrType = PickCreateComponentType<'attr'>
|
||||
|
||||
export const useComponentStyle = (attr: AttrType, index: number) => {
|
||||
if(!attr) return {}
|
||||
const componentStyle = {
|
||||
zIndex: index + 1,
|
||||
left: `${attr.x}px`,
|
||||
@@ -12,6 +13,7 @@ export const useComponentStyle = (attr: AttrType, index: number) => {
|
||||
}
|
||||
|
||||
export const useSizeStyle = (attr: AttrType, scale?: number) => {
|
||||
if(!attr) return {}
|
||||
return {
|
||||
width: `${scale ? scale * attr.w : attr.w}px`,
|
||||
height: `${scale ? scale * attr.h : attr.h}px`
|
||||
|
||||
Reference in New Issue
Block a user