Skip to content

[需求] 为 cc.Button 组件增加一个 通过代码设置 点击事件 的API #104

@finscn

Description

@finscn

Use Case

目前 button组件 并没有简单的通过代码设置点击事件的功能.
希望提供一个. 比如

button.on(ButtonEvent.CLICK, (event)=>{....})

因为 Button组件处理点击事件的逻辑比较特殊 , 并不能直接用

button.node.on(CLICK, ...) 来代替

所以还是希望官方提供一个专属API.

Problem Description

.

Proposed Solution

No response

How it works

No response

Alternatives Considered

.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions