Create a Vue App
1 2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(htmltools)
tags$div(
tags$label('Enter your name'),
tags$input(type = "text", "v-model" = "name"),
tags$p("Hello {{name}}")
) %>%
Vue(data = list(name = ""))
if (interactive()){
library(shiny)
ui <- tags$div(
tags$label('Enter your name'),
tags$input(type = "text", "v-model" = "name"),
textOutput("greeting")
) %>%
Vue(data = list(name_ = ""))
server <- function(input, output, session){
output$greeting <- renderText({
paste("Hello", input$name)
})
}
shinyApp(ui = ui, server = server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.