1

我正在通过 R markdown 构建 Flexdashboard UI。如果我删除标题栏中的输出:flexdashboard::flex_dashboard,我会看到禁用 textInput 有效。

     ---
    title: "without ui and server"
    runtime: shiny
    ---

     ```{r setup, include=FALSE}
      library(flexdashboard)
      library(shiny)
      library(shinyjs)
     ```

     Inputs {.sidebar}
     -----------------------------------------------------------------------

     ```{r, echo=FALSE}

      useShinyjs(rmd = TRUE)
      disabled(textInput("id", "Id", "0"))
      textInput("X1", "X1", "")

      #action buttons
      actionButton("submit", "Submit Changes")

      ```

如果我包含该行output: flexdashboard::flex_dashboard,它将不起作用。文本框未禁用。

                 ---
                 title: "without ui and server"
                 output: 
                 flexdashboard::flex_dashboard:
                 runtime: shiny
                 ---

                 ```{r setup, include=FALSE}
                    library(flexdashboard)
                    library(shiny)
                    library(shinyjs)
                  ```

                  Inputs {.sidebar}
                  -----------------------------------------------------------------------

                  ```{r, echo=FALSE}

                   useShinyjs(rmd = TRUE)
                   disabled(textInput("id", "Id", "0"))
                   textInput("X1", "X1", "")

                   #action buttons
                   actionButton("submit", "Submit Changes")

                  ```

很想知道是否有其他人遇到此问题以及有关解决此问题的任何建议。

4

0 回答 0