2 回答
TA贡献1880条经验 获得超4个赞
如果你把它应该工作selectize = FALSE
。
默认情况下,selectInput
有selectize = TRUE
它使用selectize.js。
因此,如果您按原样运行代码,那么您应该会看到您的选择显示为 display: none
所以你output$menu会像
output$menu<-renderUI({
sidebarPanel(width = 2,
selectInput("sel","",
choices = c("Home","About","Sector A","Sector B","Sector C"),
selected = "Home", selectize = FALSE),
tags$style(
"select#sel {background: #FFA500}"
)
)
})
TA贡献1789条经验 获得超8个赞
根据您编辑的问题,您可能会在周围使用 div 容器 selectInput
div(
selectInput("sel","",
choices = c("Home","About","Sector A","Sector B","Sector C"),
selected = "Home"),
style = "background: #FFA500"
)
或者,如果您想设置整个侧边栏面板的样式,请设置样式 form.well
sidebarPanel(
width = 2,
selectInput(
"sel","",
choices = c("Home","About","Sector A","Sector B","Sector C"),
selected = "Home"),
tags$style(
"form.well {background: #FFA500}"
)
)
添加回答
举报