简体   繁体   English

更改 shiny 中的下拉菜单

[英]Alter dropdown menu in shiny

In the below application, is there a way to remove number 3 (Basically, can we remove number displaying there)?在下面的应用程序中,有没有办法删除数字 3(基本上,我们可以删除那里显示的数字)? Only message box needs to be displayed there那里只需要显示消息框

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(dropdownMenu(type = "messages",
                               messageItem(
                                 from = "Sales Dept",
                                 message = "Sales are steady this month."
                               ),
                               messageItem(
                                 from = "New User",
                                 message = "How do I register?",
                                 icon = icon("question"),
                                 time = "13:45"
                               ),
                               messageItem(
                                 from = "Support",
                                 message = "The new server is ready.",
                                 icon = icon("life-ring"),
                                 time = "2014-12-01"
                               )
  )),
  dashboardSidebar(),
  dashboardBody()
)

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

shinyApp(ui, server)

结果

Not sure if I understand your question correctly, but I guess this is what you are after?不确定我是否正确理解了您的问题,但我想这就是您所追求的吗?

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(dropdownMenu(type = "messages",
                               messageItem(
                                 from = "Sales Dept",
                                 message = "Sales are steady this month."
                               ),
                               messageItem(
                                 from = "New User",
                                 message = "How do I register?",
                                 icon = icon("question"),
                                 time = "13:45"
                               ),
                               messageItem(
                                 from = "Support",
                                 message = "The new server is ready.",
                                 icon = icon("life-ring"),
                                 time = "2014-12-01"
                               )
  )),
  dashboardSidebar(),
  dashboardBody(
                tags$script(HTML(
                  "document.querySelector('body > div.wrapper > header > nav > div > ul > li > a > span').style.visibility = 'hidden';"
                ))
                )
)

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

shinyApp(ui, server)

结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM