2017-09-01 4 views
0

私は4つのmenuItemでこの光沢のあるアプリを持っています。 1つは「ログイン」と呼ばれ、tabA、tabBおよびtabCは条件付きパネルの下にあり、ログインが正常に完了したときにのみ表示されます。光沢のあるアプリappuituitem内の条件パネル変形

enter image description here

誰かがUIが変更された理由についてのヒントを与えることができますか? 4つのタブはすべて最初のものと正確に一致するはずです。

ui.Rコード:

menuItem('Login', tabName = 'Login', icon = icon('fa fa-address-book')), 
conditionalPanel(" 'TRUE' === 'TRUE' ",            
       menuItem("tabA", tabName = "tabA", icon = icon("fa fa-book")), 
       menuItem("tabB", tabName = "tabB", icon = icon("fa fa-line-chart")), 
       menuItem("tabC", icon = icon("fa fa-database"))) 

答えて

1

一つの選択肢はsidebarMenu

出力に

enter image description here

を与える
library(shiny) 
library(shinydashboard) 

ui <- dashboardPage(
    dashboardHeader(
    title = "Shiny" 
), 

    dashboardSidebar(
    sidebarMenu(id="menu", 
       menuItem('Login', tabName = 'Login', icon = icon('user-o')), 
       conditionalPanel(" 'TRUE' === 'TRUE' ", 
       sidebarMenu(menuItem("tabA", tabName = "tabA", icon = icon("quora")), 
       menuItem("tabB", tabName = "tabB", icon = icon("superpowers")), 
       menuItem("tabC", tabName = "tabC", icon = icon("podcast")))) 
    ) 
), 

    dashboardBody(
    tabItems(
     tabItem("Login",h1("login")), 
     tabItem("tabA",h1("a")), 
     tabItem("tabB",h1("b")), 
     tabItem("tabC", h1("c")) 

    ) 


) 
) 


server <- function(input, output) { 
    observe(print(input$menu)) 
} 

shinyApp(ui,server) 

でラップするべきである、事前にありがとう

関連する問題