闪亮的标签项目闪亮的仪表板



我正在设置一个shinydashboard应用程序。下面是一个工作UI的例子:

shinyUI(dashboardPage(
dashboardHeader(title = tags$a("Learning Objectives",href='http://pluralsight.com',tags$img(src='logo.png'),
tags$head( tags$link(rel="stylesheet",type="text/css",href="pluralsight-theme.css"))
)
),
dashboardSidebar(
sidebarMenu(
menuItem("Content Search", tabname="search",icon=icon("magnifying-glass")),
menuItem("Course Report",tabname="course",icon=icon("file-lines"))
)
),
dashboardBody(
h2("hello there")
)
)
)

你可以看到我已经定义了menuItems,但还没有使用它们。菜单项在侧边栏中显示得很好。我的css表单只是更改了一些颜色,没有任何花哨或破坏性的东西。看起来很棒。

然后,我尝试实现多选项卡:

shinyUI(dashboardPage(
dashboardHeader(title = tags$a("Learning Objectives",href='http://pluralsight.com',tags$img(src='logo.png'),
tags$head( tags$link(rel="stylesheet",type="text/css",href="pluralsight-theme.css"))
)
),
dashboardSidebar(
sidebarMenu(
menuItem("Content Search", tabname="search",icon=icon("magnifying-glass")),
menuItem("Course Report",tabname="course",icon=icon("file-lines"))
)
),
dashboardBody(
tabItems(
tabItem(tabName = 'search', h2("hello there")),
tabItem(tabName = 'course',h2("hello there"))
)
)
)
)

这将加载一个空白面板。单击选项卡不会有任何作用。

调用menuItem函数时出现拼写错误。参数应该是tabName,而不是tabname

工作应用程序:

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = tags$a("Learning Objectives",href='http://pluralsight.com',tags$img(src='logo.png'),
tags$head( tags$link(rel="stylesheet",type="text/css",href="pluralsight-theme.css"))
)
),
dashboardSidebar(
sidebarMenu(
menuItem("Content Search", tabName="search",icon=icon("magnifying-glass")),
menuItem("Course Report",tabName="course",icon=icon("file-lines"))
)
),
dashboardBody(
tabItems(
tabItem(tabName = 'search', h2("hello there")),
tabItem(tabName = 'course',h2("hello there2"))
)
)
)
server <- function(input, output, session) {

}
shinyApp(ui, server)

最新更新