vue: Create a Vue App

Description Usage Examples

View source: R/vue.R

Description

Create a Vue App

Usage

1
2
Vue(html, data = list(), dependencies = list(), ...,
  elementId = NULL)

Examples

 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)
}

ramnathv/vuer documentation built on Nov. 5, 2019, 2:59 a.m.