问题描述
在示例here中,如果我通过单击通知框中的“ x”来关闭通知,或者等待六秒钟使其自行消失,然后再次单击“显示”按钮,则通知没有出现。
我需要单击运行removeNotification(id)
的“删除”按钮,以使通知按钮再次出现。
如何获得以下行为:
AND
shinyApp(
ui = fluidPage(
actionButton("show","Show"),actionButton("remove","Remove")
),server = function(input,output) {
# A notification ID
id <- NULL
observeEvent(input$show,{
# If there's currently a notification,don't add another
if (!is.null(id))
return()
# Save the ID for removal later
id <<- showNotification(paste("Notification message"),duration = 6)
})
observeEvent(input$remove,{
if (!is.null(id))
removeNotification(id)
id <<- NULL
})
}
)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)