我正在尝试使用
在Shiny中是否有一种函数可以添加类似于消息框的东西,一旦显示了消息就可以关闭,然后用户可以继续进行?
uiOutput
在Shiny中显示诸如“用户已验证”或“帐户已创建”的消息,但它会覆盖我不需要的Shiny仪表板的主页。在Shiny中是否有一种函数可以添加类似于消息框的东西,一旦显示了消息就可以关闭,然后用户可以继续进行?
uiOutput
在Shiny中显示诸如“用户已验证”或“帐户已创建”的消息,但它会覆盖我不需要的Shiny仪表板的主页。modalDialogs
来实现,以下是一个可用的示例:library(shiny)
ui = fluidPage(
actionButton("login", "Log in"),
textInput('userid','User id:',value=' definitely not Florian')
)
server = function(input, output) {
observeEvent(input$login, {
showModal(modalDialog(
title = "You have logged in.",
paste0("It seems you have logged in as",input$userid,'.'),
easyClose = TRUE,
footer = NULL
))
})
}
shinyApp(ui,server)
希望这能帮到你!
insertUI
和removeUI
,但基本的shiny并没有“消息框”作为UI,您需要使用一些CSS进行自定义。 - agenis