그 문장이 dropdownMenu
기능에 하드 코딩되어 나타납니다
function (..., type = c("messages", "notifications", "tasks"),
badgeStatus = "primary", icon = NULL, .list = NULL)
{
type <- match.arg(type)
if (!is.null(badgeStatus)) validateStatus(badgeStatus)
items <- c(list(...), .list)
lapply(items, tagAssert, type = "li")
dropdownClass <- paste0("dropdown ", type, "-menu")
if (is.null(icon)) {
icon <- switch(type, messages = shiny::icon("envelope"),
notifications = shiny::icon("warning"), tasks = shiny::icon("tasks"))
}
numItems <- length(items)
if (is.null(badgeStatus)) {
badge <- NULL
}
else {
badge <- span(class = paste0("label label-", badgeStatus),
numItems)
}
tags$li(
class = dropdownClass,
a(
href = "#",
class = "dropdown-toggle",
`data-toggle` = "dropdown",
icon,
badge
),
tags$ul(
class = "dropdown-menu",
tags$li(
class = "header",
paste("You have", numItems, type)
),
tags$li(
tags$ul(class = "menu", items)
)
)
)
}
우리는 문장이 paste("You have", numItems, type)
에 내장되어 있음을 참조하십시오.
ui <- dashboardPage(
dashboardHeader(dropdownMenuCustom(type = "messages",
customSentence = customSentence,
messageItem(
from = "Sales Dept",
message = "Sales are steady this month."
))),
dashboardSidebar(),
dashboardBody()
)
server <- function(input, output) { }
shinyApp(ui, server)
그래서 함께 문장 전체 덮어 쓰기를 제거 :
하는 A 최소한의 예 : 그 변경 한 가지 방법은 당신이 원하는 문장으로 새 매개 변수를 사용 새로운 기능을 작성하는 것입니다 빈 공간 - 또는 짧은 커팅이있을 것인가? – user7066213
이것은 오류를 제공합니다 : 오류 : 'tagAssert'객체가 없습니다 - 아이디어가 있습니까? – user7066213
게시하기 전에 코드를 시도하지 않았습니다. 죄송합니다. – denrou