0

リアクティブ オブジェクトに基づいて、ダッシュボード ヘッダーのドロップダウン メニューまたは通知項目をレンダリングすることは可能ですか? 私の試みはうまくいきませんでした。

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
  dashboardHeader(uiOutput("drop")),
  dashboardSidebar(),
  dashboardBody()
)

server <- function(input, output) { 
  values<-reactiveValues()
  values[["numvotes"]]<-1
  output$drop<-renderUI({
    dropdownMenu(type = "notifications", badgeStatus = "warning",
                 notificationItem(icon = icon("ok", lib = "glyphicon"), status = "danger",
                                  paste(values[["numvotes"]],"vote(s)")
                 )                 )
  })
  }

shinyApp(ui, server)
4

1 に答える 1