有沒有辦法使用updateSelectizeInput的HTML標籤(例如h6)(它正在爲selectInput工作,請參閱下面的代碼)?下面的代碼簡單地使用updateSelectizeInput [object Object]中的h6(「Label」)作爲輸出。R shiny updateSelectizeInput標籤的自定義HTML標籤
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))
感謝
這很明顯看起來是一個錯誤。如果你在'as.character'中更新'h6',你會直接得到'h6'標籤。我將在github上提交bug報告 – Carl
https://github.com/rstudio/shiny/issues/1451 – Carl
感謝您的參與。 – ChriiSchee