![](/img/trans.png)
[英]How to use shiny:renderUI and shiny:UiOutput to produce conditional outputs with shiny modules
[英]Shiny does not render uiOutput data in modules
我有這個代碼:
columnSelectorUI <- function(id) {
ns <- NS(id)
return(
wellPanel(
h4("Select columns"),
uiOutput(ns("tab"))
))
}
columnSelectorServer <- function(input, output, session) {
print("XXX")
state <- reactiveValues()
print(renderUI({h2("hello")}))
print(output)
output$tab <- renderUI({div(HTML("hello"))})
}
我看到的是:
<div id="columnSelector-tab" class="shiny-html-output shiny-bound-output"></div>
已解決:當調用 UI 組件時,我在頂級小部件中缺少 ns() 調用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.