如何在R的闪亮应用程序的仪表板侧栏中使图标动态化

时间:2019-07-02 14:12:47

标签: r shiny shinydashboard shiny-server shiny-reactivity

我正在尝试获取menuItem的徽章以根据服务器上的某些条件进行更新。

这是针对我自己的闪亮应用程序,当我当前未查看菜单项中的错误时,我想通知我

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Split app code across multiple files"),
  dashboardSidebar(
      sidebarMenu(
      id ="menu",
      menuItem("Dashboard", tabName = "dashboard",icon = icon("dashboard")),
      menuItem("Widgets", tabName = "widgets",icon = icon("th"),
              badgeLabel = "new", badgeColor = "green")),
      menuItem("Help", tabName = "help", icon = icon("question"))
  )
    ),
  ),
  dashboardBody(
    tabItems(
      # include the UI for each tab
      source(file.path("ui", "tab1.R"), local = T)$value,
      source(file.path("ui", "tab2.R"), local = T)$value
    )
  )
)

server <- function(input, output, session) {

}

shinyApp(ui = ui, server = server)

0 个答案:

没有答案