我想为我闪亮的应用程序提供动态标签.我尝试了下面的代码
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
checkboxGroupInput("Tabs",
label = h4("tabpanel"),
choices = list("tabs" = "tabs"),
selected = NULL),
checkboxGroupInput("moreTabs",
label = h4("moretabpanel"),
choices = list("moretabs" = "moretabs"),
selected = NULL)
),
dashboardBody(
conditionalPanel(
condition = "input.Tabs == 'tabs'",
tabBox(
title = "intro",
id= "ttabs", width = 8, height = "420px",
tabPanel("Files", dataTableOutput("Files")),
conditionalPanel(
condition = "input.moreTabs == 'moretabs'",
tabPanel("Files1", dataTableOutput("Files1"))
)
)
)
)
)
server <- function(input, output) { }
shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)
但是,我没有成功动态使用选项卡面板.它只显示一个选项卡,在检查时,它应该显示第二个选项卡.