我有下面的闪亮仪表板,其中有 3 个 tabPanel。在第一个 tabPanel"Resource Allocation"
中,我希望默认打开左侧和右侧边栏。在第 2 和第 3 个选项卡面板 ( "Time Series","Longitudinal View"
) 中,我只希望左侧边栏和右侧边栏不仅隐藏,而且根本无法通过推动其"gears"
上方的图标打开,应该将其删除。在第四个面板中,"User Guide"
我根本不想打开侧边栏,也不想打开其中一个。
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(shinyjs)
shinyApp(
ui = dashboardPage(
options = list(sidebarExpandOnHover = TRUE),
header = dashboardHeader(
titleWidth = "0px"
),
sidebar = dashboardSidebar(minified = TRUE, collapsed = F),
body = dashboardBody(
useShinyjs(),#tags$head(tags$script(src="format_number.js")),
tags$script("document.getElementsByClassName('sidebar-toggle')[0].style.visibility = 'hidden';"),
tabsetPanel(
tabPanel("Resource Allocation"),
tabPanel("Time Series"),
tabPanel("Longitudinal View"),
tabPanel("User Guide")
)
),
controlbar = dashboardControlbar(collapsed = F),
title = "DashboardPage"
),
server = function(input, output) { }
)