gpt4 book ai didi

r - 在 flexdashboard 中将滚动添加到侧边栏

转载 作者:行者123 更新时间:2023-12-04 11:55:48 27 4
gpt4 key购买 nike

我正在使用 Flexdashboard 设计 UI,并且一些文本输入框超出了常规浏览器窗口,我在代码中添加了一行 vertical_layout: scroll 但我猜这还不够吗?所以我的问题是如何启用垂直滚动功能,如下图所示。 ?非常感谢任何提示或指示。

enter image description here

下面是我的代码

---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: scroll
smooth_scroll: true
runtime: shiny
---

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

Inputs {.sidebar}
-----------------------------------------------------------------------

```{r}
library(shiny)
library(shinyjs)


shinyjs::useShinyjs()
#tags$hr(),
shinyjs::disabled(textInput("id", "Id", "0"))
textInput("X1", "X1", "")
textInput("X2", "X2", "")
textInput("X3", "X3", "")
textInput("X4", "X4", "")
textInput("X5", "X5", "")
textInput("X6", "X6", "")
textInput("X7", "X7", "")
textInput("X8", "X8", "")
textInput("X9", "X9", "")
textInput("X10", "X10", "")
textInput("X11", "X11", "")
textInput("X12", "X12", "")

textInput("X13", "X13", "")
textInput("X14", "X14", "")
textInput("X15", "X15", "")
textInput("X16", "X16", "")

checkboxInput("X17", "X17", FALSE)


#action buttons
actionButton("submit", "Submit Changes")


```

最佳答案

此问题已在此处解决:https://github.com/rstudio/flexdashboard/issues/27

您可以通过从 GitHub 安装最新版本来使用带有修复程序的版本:

devtools::install_github("rstudio/flexdashboard")

或者,您可以将此 CSS 片段添加到您的仪表板:
<style type="text/css"> .sidebar { overflow: auto; } </style>

关于r - 在 flexdashboard 中将滚动添加到侧边栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37369170/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com