R Shiny仪表板tabName不能与menuItem和嵌套输入一起使用

时间:2017-10-10 10:59:39

标签: r shiny shinydashboard

当包含嵌套输入时,

tabName未在shinydashboard的menuItem中拾取。关于变通方法的任何想法?

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(
    sidebarMenu(id = "sbm",
                menuItem("Dashboard", tabName = "dashboard"),
                menuItem("Select Something", tabName = "select_smt",
                  selectInput("inputTest", "Input Test",choices = c("a", "b"))
                  ),
                menuItem("No Select", tabName = "no_select")
                )
    ),
  dashboardBody(
    tabItems(
      tabItem(tabName = "dashboard",h2("Dashboard with no nest input")),
      tabItem(tabName = "select_smt",h2("Content with nested input")),
      tabItem(tabName = "no_select", h2("No nested input"))
    ) #
  )
)

server <- function(input, output) {}

shinyApp(ui, server)

0 个答案:

没有答案