单击闪亮的actionbutton转到flexdashboard的另一页

The*_*aya 2 user-interface user-experience shiny 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
=======================
Run Code Online (Sandbox Code Playgroud)

最初,我的应用程序位于第1页上。我想通过单击按钮将我的应用程序带至第2页clickMe。请在这件事上给予我帮助..!

Hub*_*rtL 5

您可以使用如下onClick参数:

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