为什么我的闪亮仪表板自定义CSS无法正常工作?

我正在遵循以下说明:

https://rstudio.github.io/shinydashboard/appearance.html

但是我得到这个错误:

警告:$:$运算符错误对原子向量无效   55:dots_list   54:标签$ section   51:dashboardSidebar

这是我的代码:

library(shinydashboard)

ui <- dashboardPage(
  dashboardheader(),dashboardSidebar(
    # Custom CSS to hide the default logout panel
    tags$head(tags$style(HTML('.shiny-server-account { display: none; }'))),# The dynamically-generated user panel
    uiOutput("userpanel")
  ),dashboardBody()
)

server <- function(input,output,session) {
  output$userpanel <- renderUI({
    # session$user is non-NULL only in authenticated sessions
    if (!is.null(session$user)) {
      sidebarUserPanel(
        span("Logged in as ",session$user),subtitle = a(icon("sign-out"),"Logout",href="__logout__"))
    }
  })
}

shinyApp(ui,server)

与说明中一样。错误在这一行

tags$head(tags$style(HTML('.shiny-server-account { display: none; }'))),

由于我将其取出,错误消失了。

很长时间以来,我一直有与此类似的代码,但是它突然停止了工作。非常感谢您的帮助。

hustsky123 回答:为什么我的闪亮仪表板自定义CSS无法正常工作?

重新安装Rstudio后,问题消失了。我不知道为什么。

本文链接:https://www.f2er.com/3098615.html

大家都在问