我发现bsModal可以按预期使用流体页面,但不能没有它。只需单击“查看表”按钮即可查看差异。
带有fluidPage的版本:
library(shiny)
library(shinyBS)
shinyApp(
ui =
fluidPage(
sidebarLayout(
sidebarPanel(
actionButton("tabBut", "View Table")
),
mainPanel(
bsModal("modalExample", "Data Table", "tabBut", size = "large",
"distTable")
)
)
),
server =
function(input, output, session) {}
)
没有fluidPage的版本,唯一的变化就是fluidPage被tagList代替了:
library(shiny)
library(shinyBS)
shinyApp(
ui =
tagList(
sidebarLayout(
sidebarPanel(
actionButton("tabBut", "View Table")
),
mainPanel(
bsModal("modalExample", "Data Table", "tabBut", size = "large",
"distTable")
)
)
),
server =
function(input, output, session) {}
)
谁能帮我解释一下bsModal和fluidPage之间发生了什么?