有没有办法将 HTML 标签(例如 h6)用于 updateSelectizeInput(适用于 selectInput,请参阅下面的代码)?在下面的代码中,只需在 updateSelectizeInput [object Object] 中使用 h6("Label") 即可显示为输出。
rm(list = ls())
library(shiny)
ui =fluidPage(
selectizeInput('DropDownSelectize',choices=NULL,label=""),
selectInput('DropDownSelect',choices = c("choice1","choice2","choice3"),
label=h6("Label"))
)
server = function(input, output, session) {
observe({
updateSelectizeInput(session,
'DropDownSelectize',
label = h6("Label"),
choices = c("choice1","choice2","choice3"),
selected = "choice1",
server = TRUE)
})
}
runApp(list(ui = ui, server = server))
Run Code Online (Sandbox Code Playgroud)
谢谢