如何解决如何禁用 bs4dash (2.0.0.9000) 的dashboardHeader?
我正在尝试禁用仪表板的标题组件。下面的代码是我这样做的尝试,使用 arg disable=TRUE。但是,此代码失败,因为标题仍然显示。
library(shiny)
library(bs4Dash)
library(shinyWidgets)
library(shinyjs)
loginpage <- div(id = "loginpage",bs4Card(width = 8,collapsible = FALSE,headerBorder = FALSE,textInput("userName",placeholder="Username",label = tagList(icon("user"),"Username")),passwordInput("passwd",placeholder="Password",label = tagList(icon("unlock-alt"),"Password")),br(),div(
style = "text-align: center;",actionButton("login","SIGN IN",width = '100%',style = "color: white; background-color:#000000;"),shinyjs::hidden(
div(id = "nomatch",tags$p("Oops! Incorrect username or password!",style = "color: red; font-weight: 600; padding-top: 5px;font-size:16px;",class = "text-center"))),))
)
ui <- dashboardPage(
dashboardHeader(id = "header",disable = TRUE,compact = TRUE),dashboardSidebar(disable = TRUE),dashboardBody(
useShinyjs(),fluidRow(align = "center",setBackgroundImage(
src = "https://www.fillmurray.com/1920/1080",shinydashboard = TRUE),column(width = 4,offset = 4,style = "margin: 0;position: absolute;
top: 50%;left: 50%;-ms-transform: translate(-50%,-50%);transform: translate(-50%,-50%);",loginpage
)
)
)
)
server = function(input,output,session) {
shinyjs::hide(id = "header",anim = FALSE)
}
# Run the application
shinyApp(ui = ui,server = server)
我还研究了使用 shiny - how to disable the dashboardHeader 的闪亮 js() 方法。然而,使用该答案给了我一个错误:
错误:shinyjs:extendShinyjs:必须提供functions
参数。
The ui of my attempt (failed to disable dashboardheader)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。