我构建了一个简单的例子,ui1基于(有光泽的)navbarPage,而在ui2中我使用了闪亮的dashboardpage。 在ui1中,我能够使用tabsetPanel在彼此之下呈现tabPanel,在闪亮的仪表板中,我无法做同样的事情。 如何在闪亮的仪表板页面中的ui1示例中实现tabsetPanel?
library(shiny)
library(shinydashboard)
ui1 = dashboardPage(
dashboardHeader(title = "tabBoxes"),
dashboardSidebar(),
dashboardBody(
tabPanel("Main1",
tabsetPanel(
tabPanel("tab1","TAB1"),
tabPanel("tab2","TAB2")
)),
tabPanel("Main2",textOutput("text"))
)
)
ui2=navbarPage("tabBoxes",
tabPanel("Main1",
tabsetPanel(
tabPanel("tab1","TAB1"),
tabPanel("tab2","TAB2")
)),
tabPanel("Main2",textOutput("text"))
)
server = function(input, output) {
# The currently selected tab from the first box
output$text <- renderText({
paste("hi")
})
}
shinyApp(ui=ui1,server=server)
shinyApp(ui=ui2,server=server)