Skip to content

交互状态

可以像 CSS 一样为元素增加 hoverpressfocusselecteddisabled 交互状态样式

注意事项

需安装 交互状态插件 才能使用。

按钮交互效果

ts
import { Leafer, Rect } from 'leafer-ui'
import '@leafer-in/state'

const leafer = new Leafer({ view: window })

const rect = new Rect({
    width: 100,
    height: 100,
    fill: 'rgba(50,205,121, 0.7)',
    cornerRadius: 30,
    hoverStyle: { fill: 'rgba(50,205,121, 0.8)' },
    pressStyle: { fill: 'rgba(50,205,121, 1)' },
    cursor: 'pointer'
})

leafer.add(rect)

恭喜 🎉

你已完成进阶知识的学习,接下来将带你了解几个重要的入门概念,就算完成入门的学习了。

下一步

坐标体系

Released under the MIT License.