r - 如何禁用 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"))),
br(),
))
)
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)
我还研究了使用闪亮的闪亮 js() 方法- 如何禁用 dashboardHeader。然而,使用那个答案给了我一个错误:
错误:shinyjs:extendShinyjs:
functions
必须提供参数。
解决方案
推荐阅读
- android - 在linux中构建cordova应用程序时出错
- flutter - Flutter 如何使用 httpServer 接收数据
- java - 即使使用调度程序,记分板也不会更新
- python - 在 pandas 中使用 openpyxl 编写时损坏的工作簿
- java - 如何修复 if 语句?
- python - 我正在使用 Pygame.time.delay(x) 函数,但程序仍然响应我在此期间所做的事情
- javascript - 在感兴趣的元素之间拆分字符串
- python - 有没有办法使用 MLB-StatsAPI 查找以前的五场比赛?
- javascript - jQuery获取长度td匹配数据属性
- reactjs - Reactjs 和 AWS Amplify - 错误生成