我需要阻止用户访问其他选项卡,直到完成某些操作。在这个可重现的示例中,我想阻止用户访问,Tab 2直到他按下按钮。
这是应用程序的外观:
这是应用程序的代码:
library(shiny)
ui <- shinyUI(navbarPage("",
tabPanel(h1("Tab1"), value = "nav1",
mainPanel(
br(),
h2("The user must press this button to access the other tab."),
br(),
shiny::actionButton('button', 'press the button')
)
),
tabPanel(h1("Tab2"),
value = "nav2",
h3('Block access until user presses button')
)
)
)
server <- shinyServer(function(input, output) {
})
# Run the application
shinyApp(ui = ui, server = server)
我希望用户能够看到 Tab2 存在,但在他们按下按钮之前使其无法点击。
有任何想法吗?

