r语言 - 如何删除 bsmodal 上的页脚



我一直在四处寻找,我找到的文档说他们在bsmodal函数中添加了一个页脚和button.close参数,但它似乎不起作用。有没有人知道如何删除(甚至只是更改(关闭按钮,和/或删除 bsmodal 弹出窗口的整个页脚部分?

这是一个工作测试应用程序。我添加了一些 css 元素,以防有人可能有兴趣看到它的应用(我在我自己的实际应用程序中使用调整(

信息在这里找到:如果我像示例中一样应用它,它只会在弹出窗口中打印 false。

library(shiny)
library(shinyBS)
server <- function(input, output){
}
ui <- fluidPage(
fluidRow(
actionButton(inputId = "test", label = "test", style = "background-color:red")
),
bsModal(id = "AppZoom", 
title = div(HTML('<span style="color:white; font-size: 40px; font-weight:bold; font-family:sans-serif ">Zoom Factor App<span>')), 
actionButton(inputId = "Abutton", label = "SOMEBUTTON", style = "background-color:red"),
trigger = "test", 
size = "small", 
footer = NULL, close.button = FALSE
),
tags$head(tags$style(HTML(".modal-body {padding: 10px} 
.modal-content  {-webkit-border-radius: 6px !important;-moz-border-radius: 6px !important;border-radius: 6px !important;}
.modal-sm { width: 380px;}
.modal-header {background-color: #3c8dbc; border-top-left-radius: 6px; border-top-right-radius: 6px}
.modal { text-align: right; padding-right: 20px; padding-top: 24px;} 
.modal-dialog { display: inline-block; text-align: left; vertical-align: top;} ")))
)
shinyApp(ui = ui, server = server)

您还可以使用 CSS 将页脚的显示属性设置为"none":

bsModal('boxPopUp1', 'test','test'),
tags$head(tags$style("#boxPopUp1 .modal-footer{ display:none}"))

希望这有帮助!

似乎要启用该功能,您需要从 GitHub 安装最新版本的shinyBS,请使用以下命令进行安装:

install.packages("devtools")
devtools::install_github("ebailey78/shinyBS")

请注意,它可能是一个不稳定的版本,所以要小心。

最新更新