我有以下代码,并在带有子项目的侧边栏菜单中单击“数据集”,仪表板主体不会更改为tabItem中的文本。理想情况下,单击“数据集”时,主体应显示“数据集菜单子项内容”。我提到了类似的线程,但没有成功。谁能帮忙。
library(shiny)
library(shinydashboard)
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Documentation", tabName = "documentation"),
menuItem("Dataset", tabName="dataset",icon = icon("info"),
menuSubItem(fileInput("Input", "Upload input file:")),
menuSubItem(numericInput("samples",label="Samples",value=0,max=10)))))
body <- dashboardBody(
tabItems(
tabItem(tabName = "documentation",div(p("Dashboard tab content"))),
tabItem(tabName = "dataset",div(p("Dataset menu sub-items content")))))
ui <- dashboardPage(dashboardHeader(title = "Test"),
sidebar,
body)
server <- function(input, output, session) {
}
shinyApp(ui, server)