CNFeffery / feffery-antd-components

Dash + Ant Design = 😍
http://fac.feffery.tech
MIT License
317 stars 24 forks source link

Button Pattern-Matching不生效 #255

Closed xuanq closed 1 month ago

xuanq commented 1 month ago

复现代码: button = fac.AntdButton( "下载", id={"type": "button_download_file", "index": filepath}, icon=fac.AntdIcon(icon="antd-download"),

@callback( Output({"type": "download_file", "index": MATCH}, "data"), Input({"type": "button_download_file", "index": MATCH}, "n_clicks"), State({"type": "button_download_file", "index": MATCH}, "id"), ) def func(n_clicks, id): return dcc.send_file(id["index"])

点击按钮不会触发callback 换成html.Button或dbc.Button则可以正常触发

CNFeffery commented 1 month ago

@xuanq 请注意,fac.AntdButton的点击事件对应的属性名叫nClicks,我们采用的是antd一致的小驼峰变量命名法