R flash中的页面刷新按钮

前端之家收集整理的这篇文章主要介绍了R flash中的页面刷新按钮前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试在链接 here之后实现页面刷新按钮.但是当我在shinyapp.io中累积部署时,它失败并要求安装我已经完成的v8.该应用程序在机器上正常工作.我用过的电路是

  1. jsResetCode <- "shinyjs.reset = function() {history.go(0)}",useShinyjs(),# Include shinyjs in the UI
  2. extendShinyjs(text = jsResetCode),` # Add the js code to the page
  3.  
  4.  
  5. p(actionButton("reset_button","Reset Tool"))

服务器

  1. observeEvent(input$reset_button,{js$reset()})

有没有办法做没有shinejs的thios?

解决方法

为了完整,下面的代码是一个使用“刷新”按钮的工作Shiny应用程序的最小示例

  1. library(shiny)
  2. library(shinyjs)
  3.  
  4. jscode <- "shinyjs.refresh = function() { history.go(0); }"
  5.  
  6. ui <- fluidPage(
  7. useShinyjs(),extendShinyjs(text = jscode),textInput("text","Text"),actionButton("refresh","Refresh app")
  8. )
  9.  
  10. server <- function(input,output,session) {
  11. observeEvent(input$refresh,{
  12. js$refresh();
  13. })
  14. }
  15.  
  16. shinyApp(ui = ui,server = server)

编辑:从闪亮版本0.13.0开始,可以使用Shiny的session $reload()函数刷新页面

猜你在找的Flash相关文章