我的目标是在selectInput按钮的标签中包含一个操作链接(显示帮助文本)。

library(shiny)

ui <- fluidPage(
  br(),
  selectInput(
    inputId = "some_id",
    label = "Please choose A or B (get help)",
    choices = c("choice A", "choice B"),
    selected = "choice A",
    selectize = F
  ),
  actionLink(inputId = "action_link", label = "get help")
) # fluidPage

server <- function(input, output) {}

shinyApp(ui, server)

r - 如何在按钮标签中包含 Action 链接?-LMLPHP

我猜解决方案是使用label = HTML(...),但是我不知道如何用纯HTML重写动作链接。

最佳答案

  selectInput(
    inputId = "some_id",
    label = HTML("Please choose A or B",
                 as.character(actionLink(inputId = 'action_link', label = 'get help'))),
    choices = c("choice A", "choice B"),
    selected = "choice A",
    selectize = F
  )

关于r - 如何在按钮标签中包含 Action 链接?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54443020/

10-12 16:30