【发布时间】:2023-03-04 02:43:01
【问题描述】:
我正在使用 auth0 包进行闪亮的身份验证。包中包含auth0::logoutButton()。我想将这些按钮放在 Shiny 应用程序中 NavbarPage 的右侧。这是一个简单的应用程序:
library(shiny)
library(markdown)
ui <- navbarPage("Navbar!",
tabPanel("Plot",
sidebarLayout(
sidebarPanel(
radioButtons("plotType", "Plot type",
c("Scatter"="p", "Line"="l")
)
),
mainPanel(
plotOutput("plot")
)
)
),
tabPanel("Summary",
verbatimTextOutput("summary")
)
###
# HERE ADD loginButton() in new panel that will be on the right side for test any actionbutton
###
)
server <- function(input, output, session) {
output$plot <- renderPlot({
plot(cars, type=input$plotType)
})
output$summary <- renderPrint({
summary(cars)
})
output$table <- DT::renderDataTable({
DT::datatable(cars)
})
}
shinyApp(ui = ui, server = server)
您可以尝试使用actionbutton 而不是loginButton。解决方法是一样的。
【问题讨论】: