Skip to content
导航

Frame

创建画板。

关键属性

width: number

宽度。

height: number

高度。

fill: string

默认白色背景。

clip: boolean

是否裁剪掉溢出的内容,默认为 true。

示例

ts
import { Leafer, Frame, Rect } from 'leafer-ui'

const leafer = new Leafer({ view: window, fill: 'gray' })

const frame = new Frame({ 
    x: 100,
    y: 100,
    width: 600,
    height: 400,
    fill: 'white'
})

const rect = new Rect({
    x: -100,
    y: 100,
    width: 200,
    height: 200,
    fill: '#32cd79',
    draggable: true
})

leafer.add(frame)
frame.add(rect)

继承

Group + Rect

API

Frame

Released under the MIT License.