library(shiny)
library(htmltools)
ui <- tagList(
textInput("textinput", label="Enter Something"),
div(id="app","from Vue: {{textinput}}"),
textOutput("textrepeat"),
tags$script(
"
$(document).on('shiny:connected', function(a,b,c){
var vb = new Vue({
el: '#app',
data: Shiny.shinyapp.$inputValues
});
});
"
),
vueR:::html_dependency_vue()
)
server <- function(input,output){
output$textrepeat <- renderText({paste0("from Shiny: ", input$textinput)})
}
shinyApp(ui,server)