我希望嵌入的网站显示在侧边栏菜单的右侧,但嵌入的网站显示在侧边栏菜单中。当用户按下细胞培养下的控制图时,嵌入的网站应清晰地显示在右侧。这是我的问题的图片

]1
如何修复此错误?下面是我的代码:
library(shiny)
library(shinydashboard)
ui <-
dashboardPage(skin="black",
dashboardHeader(title = "CPV Dashboard ", titleWidth = 450),
dashboardSidebar(
sidebarMenu(
menuItem("Tab 1", tabName = "tab 1", icon = icon("medicine"),
menuItem("Cell Culture",
menuItem("Control Chart", mainPanel(fluidRow(
htmlOutput("frame")))))))
),
dashboardBody())
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)发布于 2021-07-29 21:07:11
我认为您需要在dashboardPage中使用dashBoardBody。
据我所知,您当前的代码并没有做到这一点。
library(shiny)
library(shinydashboard)
ui <-
dashboardPage(
skin = "black",
dashboardHeader(title = "CPV 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)https://stackoverflow.com/questions/68582699
复制相似问题