1
我刚开始用破折号。以here为例。我想在仪表应用转换下面如何使用按钮触发回叫更新?
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div([
dcc.Input(id='my-id', value='initial value', type="text"),
html.Div(id='my-div')
])
@app.callback(
Output(component_id='my-div', component_property='children'),
[Input(component_id='my-id', component_property='value')]
)
def update_output_div(input_value):
return 'You\'ve entered "{}"'.format(input_value)
if __name__ == '__main__':
app.run_server()
要更新,当用户按下一个按钮,而不是当的输入字段的值更改。我该如何做到这一点?
这原来是重复[这](https://开头计算器.com/questions/45579844/dash-core-component-for-basic-button-click-event)问题。 – user25064