1

控制 Shiny bs4Dash 仪表板上右侧栏的参数是什么。我在https://rinterface.github.io/bs4Dash/articles/step-by-step.html上阅读的dashboardControlbar 函数,我理解为页面右侧的侧边栏,是设置disable = T,类似方式来dashboardSidebar(disable = T)控制左侧的外观侧边栏。

然而,我已经controlbar = dashboardControlbar(disable = T)在下面的 Shiny App 上进行了设置,当按下顶部的按钮时,右侧边栏仍然打开。感谢您提前提出任何建议。

编辑(响应 dashboardHeader 评论):这个问题是参考 bs4Dash V2.0.0 可通过 github 获得的。 https://github.com/RinteRface/bs4Dash 请注意github页面还推荐github版本的htmltools和shiny。

library(shiny)
library(bs4Dash)


ui = dashboardPage(
  header = dashboardHeader(),
  sidebar = dashboardSidebar(
    disable = T
    ),
  body = dashboardBody(),
  controlbar = dashboardControlbar(
    disable = T
  ),
  title = ""
)

server <- function(input, output, session) {}
shinyApp(ui, server)
4

1 回答 1

1

您可以删除 controlbar 参数以禁用它。

library(shiny)
library(bs4Dash)


ui = dashboardPage(
  header = dashboardHeader(),
  sidebar = dashboardSidebar(
    disable = T
  ),
  body = dashboardBody(),
  title = ""
)

server <- function(input, output, session) {}
shinyApp(ui, server)
于 2021-04-01T12:10:39.130 回答