【问题标题】:Why does hidden not work for dash_html_components.Label?为什么隐藏对 dash_html_components.Label 不起作用?
【发布时间】:2020-04-09 07:55:40
【问题描述】:

当我尝试用 hidden 隐藏 dash_html_components.Label 时,像这样:

app.layout = html.Label('test',hidden=True)

我仍然可以看到Label。但是当我用Div 替换Label 时,它确实有效。可能是什么原因?

它们不用于任何回调。 Labelstyle 可以覆盖它吗?但是,为什么 Div 的行为会有所不同?

谢谢!

【问题讨论】:

    标签: python html plotly-dash


    【解决方案1】:

    标签类的hidden 参数似乎被破坏了。您可以使用 style 属性来实现相同的行为:

    app.layout = html.Label('test', style={"visibility": "hidden"})
    

    app.layout = html.Label('test', style={"display": "none"})
    

    如果你想隐藏页面上没有位置的标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-28
      • 2018-04-19
      • 2014-06-08
      • 2010-12-11
      • 2010-10-05
      • 2014-06-05
      • 1970-01-01
      相关资源
      最近更新 更多