编程语言
首页 > 编程语言> > javascript – 闪亮的ui.R支持包括每个tabPanel with-in tabsetPanel上的html页面吗?

javascript – 闪亮的ui.R支持包括每个tabPanel with-in tabsetPanel上的html页面吗?

作者:互联网

我是Shiny的新手,我试图在tabsetPanel中的tabPanel上包含HTML,并且面临的问题只有一个HTML页面被渲染,所以想知道闪亮的ui.R是否支持tabsetPanel中的多HTML包含,如果是的话,那将是什么需要照顾的事情?

另外,为什么闪亮的ui.R视图页面源不显示完整的页面源?
谢谢!

ui.R示例如下(只是mainPanel提取)尝试渲染info.html / daily.html,如下所示

mainPanel(
  tabsetPanel(
    tabPanel("Info1", 
             div(h6("Top empl")),
             div(class = "row", div(showOutput("topten", "nvd3"), class = "span4")),
    )
    , tabPanel("Info2", 
             div(h6("Top empl")),
             div(class = "row", div(showOutput("topten", "nvd3"), class = "span4")),
    )
    , tabPanel("Info3", dataTableOutput(outputId="table"))     
    , tabPanel("Monthly Info", includeHTML("www/info.html"))
    , tabPanel("Daily Info",includeHTML("www/daily.html"))
    , tags$head(tags$script(src="collapsible.js"))
  )

)

解决方法:

您可以复制以下具有“每月信息”选项卡的应用程序.其内容是与app.R位于同一目录中的HTML文件.

ui <- function(input, output) {
mainPanel(
        tabsetPanel(
                tabPanel("Info1"),
                tabPanel("Info2"), 
                tabPanel("Info3"),
                tabPanel("Monthly Info",
                         includeHTML("test.html")))
        )
}

server <- function(input, output){
}

shinyApp(ui = ui, server = server)

它应该如下所示:

enter image description here

标签:javascript,html5,r,shiny,html-rendering
来源: https://codeday.me/bug/20190708/1403538.html