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