渲染后,Shinydashboard外观效果不起作用

时间:2017-06-01 07:33:43

标签: r shiny shiny-server shinydashboard

我试图在登录页面后渲染shinydashboard但是没有显示shinydashboard皮肤颜色。 我的代码如下:

ui.r

library(shinydashboard)
library(shiny)
uiOutput("page")

Login.R

 library(shinydashboard)

ui1Output <-  function(id, label = "ui1") {

  shinyUI(fluidPage(
                      mainPanel( 

                              textInput("username","Username",placeholder ="UserName"),
                              passwordInput("password","Password", placeholder ="Password"),
                              actionButton("login", "Login")
                             )))
  }

dashbaordpage.R

library(shinydashboard)
 dashpageOutput <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("Widgets", tabName = "widgets", icon = icon("th"))
    )
  ),
  dashboardBody(
    tabItems(
      # First tab content
      tabItem(tabName = "dashboard",h2("Dashbaord")),

      # Second tab content
      tabItem(tabName = "widgets",
              h2("Widgets tab content")
      )
    )
  )

global.R

source('login.R') #login page
source('dashboardPage.R')#dashbaordpage

server.R

library(shiny)
library(shinydashboard)

shinyServer(function(input, output,session) {

  output$page <- renderUI({
    ui1Output('ui1Output')

  })


  observeEvent(input$login,
               {

                 if(True)
                 {
                   output$page <- renderUI(dashpageOutput)
                  }
                 else
                 {
                   Logged<-F
                   showModal(modalDialog(
                     title = "Error",
                     "Enter Correct Username and password"
                   ))
                 }

               })

})

详细信息:当我去仪表板时显示但没有默认的肤色或任何其他肤色。我已经尝试过 skin =&#39; red&#39; 这样明智的选择。

Image for reference how actually showing after login.

请帮帮我。 提前谢谢。

0 个答案:

没有答案