首页 > 解决方案 > bs_modal 在 flexdashboard 的侧边栏中不起作用

问题描述

bsplus::bs_modal()创建一个模态对话框弹出窗口,并在列中工作,但不是侧边栏。

关于如何使(1)工作的任何想法?

作为参考,bs_modal()来源在这里flexdashboard.js这里


(1) 这有效:

---
title: "Untitled"
output: flexdashboard::flex_dashboard

---

```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
library(bsplus)
```

Sidebar {.sidebar}
-------------------------------------


```{r}

```


Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
bs_modal(id = "modal", title = "I'm a modal", body = "Yes, I am.")
bs_button("Click for modal") %>%
  bs_attach_modal(id_modal = "modal")
```

(2) 这不起作用:

---
title: "Untitled"
output: flexdashboard::flex_dashboard

---

```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
library(bsplus)
```

Sidebar {.sidebar}
-------------------------------------


```{r}
bs_modal(id = "modal", title = "I'm a modal", body = "Yes, I am.")
bs_button("Click for modal") %>%
  bs_attach_modal(id_modal = "modal")
```


Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}

```

标签: htmlcssrr-markdownflexdashboard

解决方案


推荐阅读