Dash App 中需要有一个回调函数来执行某些操作然后刷新页面,只能使用 HTML A 标签实现页面重新加载。
html.A(html.Button('Refresh Data'),href='/')
Run Code Online (Sandbox Code Playgroud)
必需的:
app.layout = html.Div([html.Button(id="refresh")])
@app.callback(Output('???', '???'),
[Input('refresh', 'n_clicks')])
def refresh(n):
## Perform some action ##
## call python function API ##
## Finally Refresh the Page ##
?
return ?
Run Code Online (Sandbox Code Playgroud)