shinydashboardPlus中默认打开右侧边栏
在shinydashboardPlus中,有没有办法让右侧边栏默认打开shinydashboardPlus中默认打开右侧边栏,r,shiny,shinydashboard,R,Shiny,Shinydashboard,在shinydashboardPlus中,有没有办法让右侧边栏默认打开 library(shiny) library(shinydashboard) shinyApp( ui = dashboardPagePlus( header = dashboardHeaderPlus( enable_rightsidebar = TRUE, rightSidebarIcon = "gears" ), sidebar = dashboardSidebar(
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPagePlus(
header = dashboardHeaderPlus(
enable_rightsidebar = TRUE,
rightSidebarIcon = "gears"
),
sidebar = dashboardSidebar(),
body = dashboardBody(),
rightsidebar = rightSidebar(
background = "dark",
rightSidebarTabContent(
id = 1,
title = "Tab 1",
icon = "desktop",
active = TRUE,
sliderInput(
"obs",
"Number of observations:",
min = 0, max = 1000, value = 500
)
)
),
title = "Right Sidebar"
),
server = function(input, output) { }
)
您必须将css类
控件侧栏open
添加到仪表板的body标记中
这可以通过以下方式完成:
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
shinyApp(
ui = tags$body(class="skin-blue sidebar-mini control-sidebar-open", dashboardPagePlus(
header = dashboardHeaderPlus(
enable_rightsidebar = TRUE,
rightSidebarIcon = "gears"
),
sidebar = dashboardSidebar(),
body = dashboardBody(
),
rightsidebar = rightSidebar(
background = "dark",
rightSidebarTabContent(
id = 1,
title = "Tab 1",
icon = "desktop",
active = TRUE,
sliderInput(
"obs",
"Number of observations:",
min = 0, max = 1000, value = 500
)
)
),
title = "Right Sidebar"
)),
server = function(input, output) {
}
)
请查找相关信息。右侧边栏是否也可以永久打开?给未来的读者。