完全删除在Shiny Dashboard中隐藏和显示侧边栏的切换按钮。

huangapple go评论120阅读模式
英文:

Totally delete the toggle button that hides and display sidebar in shiny dashboard

问题

如何完全删除在shiny dashboard中隐藏和显示侧边栏的切换按钮?

  1. ## app.R ##
  2. library(shiny)
  3. library(shinydashboard)
  4. ui <- dashboardPage(
  5. dashboardHeader(),
  6. dashboardSidebar(
  7. collapsed = TRUE
  8. ),
  9. dashboardBody(
  10. )
  11. )
  12. server <- function(input, output) { }
  13. shinyApp(ui, server)
英文:

How can I totally delete the toggle button that hides and display sidebar in shiny dashboard?

  1. ## app.R ##
  2. library(shiny)
  3. library(shinydashboard)
  4. ui &lt;- dashboardPage(
  5. dashboardHeader(),
  6. dashboardSidebar(
  7. collapsed = T
  8. ),
  9. dashboardBody(
  10. )
  11. )
  12. server &lt;- function(input, output) { }
  13. shinyApp(ui, server)

答案1

得分: 1

  1. library(shiny)
  2. library(shinydashboard)
  3. css <- ".sidebar-toggle {display: none;}"
  4. ui <- dashboardPage(
  5. dashboardHeader(),
  6. dashboardSidebar(
  7. collapsed = T
  8. ),
  9. dashboardBody(
  10. tags$head(tags$style(HTML(css)))
  11. )
  12. )
  13. server <- function(input, output) { }
  14. shinyApp(ui, server)
英文:
  1. library(shiny)
  2. library(shinydashboard)
  3. css &lt;- &quot;.sidebar-toggle {display: none;}&quot;
  4. ui &lt;- dashboardPage(
  5. dashboardHeader(),
  6. dashboardSidebar(
  7. collapsed = T
  8. ),
  9. dashboardBody(
  10. tags$head(tags$style(HTML(css)))
  11. )
  12. )
  13. server &lt;- function(input, output) { }
  14. shinyApp(ui, server)

huangapple
  • 本文由 发表于 2023年5月25日 04:21:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76327151.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定