【发布时间】:2020-10-27 08:16:04
【问题描述】:
对于我的多选项卡应用程序,我正在开发应用程序视图的快照/PDF 打印功能。
在生成 PDF 的文件中,我想从其他 tab.py 文件中访问存储在 dcc.Store 中的组件。
index.py
app.layout = html.Div([
# header
html.Div([
# Store component for tab1.py
dcc.Store(id="store1", storage_type="local"),
# Store component for tab2.py
dcc.Store(id="store2", storage_type="local"),
],
)
])
pdf 生成文件返回 pdf 布局/设计,我想从dcc.Store 访问组件,如下所示。
def report(store1, store2):
return html.Div(
html.H2("Effective Lease Calculations"),
# Access dcc.Store component
print_value = store1['val']
html.Div(
print_value,
style={
'marginTop': '2in',
'fontSize': '28px'
}
),
)
我的问题是,你可以在不使用State("store1", "data")in 回调的情况下在本地访问dcc.Store 组件存储吗?
【问题讨论】:
标签: python callback plotly plotly-dash