【发布时间】:2021-10-06 03:15:15
【问题描述】:
现在当用户运行应用程序时,会显示所需的网站/仪表板正文,但是,我希望仅当用户从侧边栏菜单的“选项卡 1”中选择“控制图表”时才显示所需的网站/正文.这是因为我将有多个侧边栏选项卡,当取决于用户选择的网站时,嵌入的网站应该会自动更改。当用户最初运行应用程序时,仪表板正文应该是空白的。只有当他们选择Tab 1 -> Cell Culture -> Control Chart 时,他们才能看到谷歌主页。
请帮忙!
ui <-
dashboardPage(
skin = "black",
dashboardHeader(title = "Dashboard ", titleWidth = 450),
dashboardSidebar(sidebarMenu(
menuItem(
"Tab 1",
tabName = "tab 1",
icon = icon("medicine"),
menuItem("Cell Culture",
menuItem("Control Chart"))
)
)),
dashboardBody(mainPanel(fluidRow(htmlOutput("frame"))
),
))
server = function(input, output, session) {
observe({
test <<- paste0("https://google.com") #sample url
})
output$frame <- renderUI({
input$Member
my_test <- tags$iframe(src = test,
height = 800,
width = 800)
print(my_test)
my_test
})
}
shinyApp(ui, server)
【问题讨论】:
标签: r shiny shinydashboard