【问题标题】:Dash Application Python Button for refresh the page用于刷新页面的 Dash 应用程序 Python 按钮
【发布时间】:2020-03-19 18:12:44
【问题描述】:

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

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

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

?
return
?

【问题讨论】:

    标签: python plotly-dash


    【解决方案1】:

    解决了!

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

    【讨论】:

    • 谢谢!我想为这个不错的解决方法找了一个小时=)
    • 这行不通是一个更高级的模板,它有一个多页 web 应用程序。
    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      • 1970-01-01
      • 1970-01-01
      • 2021-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多