javascript - 在可折叠侧边栏闪亮中添加滑块输入
问题描述
我想在可折叠的侧边栏中添加一个滑块。我在显示与正文中的 tabName 关联的内容时遇到了一些问题。IE。当我单击选项卡时,正文中的内容不显示。
这是代码以及当我们注释掉滑块输入时的样子。
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Dynamic Menu"),
dashboardSidebar(
sidebarMenu(
menuItem("hello", tabName = "helloWorld", icon = icon("calendar")#,
#sliderInput("slide", "chose Slide", min = 5, max = 10, value = 10)
)
)
),
dashboardBody(
tabItems(
tabItem(tabName = "helloWorld",
tags$h1("hey")
)
)
)
)
server <- function(input, output, session){
}
shinyApp(ui, server)
如果我们使用滑块输入,body 就会消失。我曾尝试使用一些 java 脚本,但我似乎无法得到我正在寻找的结果。如果我决定添加另一个 menuItem,则保留在我的侧边栏中应该是可折叠的。
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Dynamic Menu"),
dashboardSidebar(
sidebarMenu(
menuItem("hello", tabName = "helloWorld", icon = icon("calendar"),
sliderInput("slide", "chose Slide", min = 5, max = 10, value = 10)
)
)
),
dashboardBody(
tabItems(
tabItem(tabName = "helloWorld",
tags$h1("hey")
)
)
)
)
server <- function(input, output, session){
}
shinyApp(ui, server)
解决方案
如果你完全移除你tabItems
的tabItem
身体会怎样?
试试这个:
dashboardBody(
tags$h1("hey")
)
或者您想根据menuItem
选择的主体拥有多个主体?
推荐阅读
- java - How to verify that IntentionAction was called on an interface file? IntelliJ Platform SDK
- google-cloud-platform - 使用 Plesk 减少谷歌云实例上的启动磁盘大小
- nginx - 使用 Nginx 将旧域重定向到新域,具有相同的子域和 URI
- apache-spark - Spark,为什么删除列会导致 Spark 作业失败?
- reactjs - Ant Design - 单击分页按钮折叠展开的行
- c# - 多语言 WPF 应用程序
- blueprism - 使用 Blue Prism,如何将单个 Excel 单元格存储为数据项?
- ruby - Ruby:如何忽略“何时”中的单词
- jquery - Find closest span element with given class within next sibling
- python - 使用 NumPy 数组索引列表时出现 TypeError:只能将整数标量数组转换为标量索引