-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvue-shiny.Rd
79 lines (65 loc) · 1.95 KB
/
vue-shiny.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vue.R
\name{vue-shiny}
\alias{vue-shiny}
\alias{vueOutput}
\alias{renderVue}
\alias{vue3Output}
\alias{renderVue3}
\title{Shiny bindings for vue}
\usage{
vueOutput(outputId, width = "100\%", height = "400px")
renderVue(expr, env = parent.frame(), quoted = FALSE)
vue3Output(outputId, width = "100\%", height = "400px")
renderVue3(expr, env = parent.frame(), quoted = FALSE)
}
\arguments{
\item{outputId}{output variable to read from}
\item{width, height}{Must be a valid CSS unit (like \code{'100\%'},
\code{'400px'}, \code{'auto'}) or a number, which will be coerced to a
string and have \code{'px'} appended.}
\item{expr}{An expression that generates a vue}
\item{env}{The environment in which to evaluate \code{expr}.}
\item{quoted}{Is \code{expr} a quoted expression (with \code{quote()})? This
is useful if you want to save an expression in a variable.}
}
\description{
Output and render functions for using vue within Shiny
applications and interactive Rmd documents.
Output and render functions for using 'vue 3' within Shiny
applications and interactive Rmd documents.
}
\examples{
if(interactive()) {
library(shiny)
library(vueR)
ui <- tagList(
tags$div(id="app-3",
tags$p("v-if"="seen", "Now you see me")
),
vue3Output('vue1')
)
server <- function(input, output, session) {
output$vue1 <- renderVue3({
vue3(
list(
el = '#app-3',
data = list(seen = TRUE),
mounted = htmlwidgets::JS("
function() {
var that = this;
setInterval(function(){that.seen=!that.seen},1000);
}
"),
watch = list(
seen = htmlwidgets::JS("function() {Shiny.setInputValue('seen',this.seen)}")
)
)
)
})
# show that Shiny input value is being updated
observeEvent(input$seen, {print(input$seen)})
}
shinyApp(ui, server)
}
}