刷新页面的Dash应用程序Python按钮

2024-05-15 22:54:09 发布

您现在位置:Python中文网/ 问答频道 /正文

是否有可能在Dash(Python)中为按钮编写回调函数以重新加载页面(如浏览器中的updatebutton)

app.layout =html.Div([
            html.Button(id="refresh"),
            ])

@app.callback(Output('???', '???'),
              [Input('refresh', 'n_clicks')])
def refresh(n):

?
return
?

Tags: 函数dividappoutputhtmlcallback浏览器
2条回答

另一种仅通过命令刷新页面的方法是:html.Meta(httpEquiv="refresh",content="60")

此命令告诉html在60秒后刷新页面

解决了

html.A(html.Button('Refresh Data'),href='/'),

相关问题 更多 >