点击闪亮的动作按钮,转到另一页flexdashboard

时间:2017-05-12 20:33:54

标签: user-interface shiny user-experience shinyjs flexdashboard

我的test.Rmd中有以下代码。

---
title: "Test Application"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
---

sidebar {.sidebar}
==========================

Controllers
-----------------------
```{r}
actionButton("clickMe", label = "Click Me", class = "btn btn-lg btn-primary")
```

Page1
========================

Page2
=======================

最初,我的应用程序位于第1页。我想点击按钮clickMe将我的应用带到Page2。请帮我这个..!

1 个答案:

答案 0 :(得分:4)

您可以使用onClick这样的参数:

actionButton("clickMe", label = "Click Me", class = "btn btn-lg btn-primary", 
             onclick="location.href='#section-page2';")