-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathREADME.Rmd
94 lines (72 loc) · 3.06 KB
/
README.Rmd
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
<!-- badges: start -->
[![R-CMD-check](https://github.com/vue-r/vueR/workflows/R-CMD-check/badge.svg)](https://github.com/vue-r/vueR/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/vueR)](https://CRAN.R-project.org/package=vueR)
[![R-CMD-check](https://github.com/vue-r/vueR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/vue-r/vueR/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
[Vue.js](https://vuejs.org) is a quiet, very popular JavaScript framework with an impressive set of features, a solid community, and MIT license. Don't tell anybody, but I think I might even like it better than React. With all this, Vue deserves its own set of helpers for `R`, just like [`d3r`](https://github.com/timelyportfolio/d3r) and [`reactR`](https://github.com/react-r/reactR).
`vueR` provides these helpers with its dependency function `html_dependency_vue()` and `htmlwidget` helper `vue()`.
### Installation
```
install.packages("vueR")
```
or for the latest if different from CRAN
```
remotes::install_github("vue-r/vueR")
```
### Example
We'll start with a recreation of the simple "Hello World" example from the Vue.js documentation. This is the hard way.
```{r eval=FALSE}
library(htmltools)
library(vueR)
browsable(
tagList(
html_dependency_vue(), # local and minimized by default
tags$div(id="app","{{message}}"),
tags$script(
"
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
});
"
)
)
)
```
`vueR` gives us an `htmlwidget` that can ease the code burden from above.
```{r eval=FALSE}
library(vueR)
library(htmltools)
# recreate Hello Vue! example
browsable(
tagList(
tags$div(id="app", "{{message}}"),
vue(
list(
el = "#app",
data = list(
message = "Hello Vue!"
)
)
)
)
)
```
Also, please check out additional [examples](https://github.com/vue-r/vueR/tree/master/inst/examples) and [experiments](https://github.com/vue-r/vueR/tree/master/inst/experiments).
### Build/Update
`vueR` is now part of a Github organization, and hopefully will be backed with interest by more than one (me) developer. For most `vueR` users, this section will not apply, but I would like to document the build/update step for new versions of `Vue`. In [`getvue.R`](https://github.com/vue-r/vueR/blob/master/build/getvue.R), I created some functions for rapid download and deployment of new `Vue` versions. Running all of the code in `getvue.R` should update local minified and development versions of Vue and also update the version references in `vueR`.
### Code of Conduct
I would love for you to participate and help with `vueR`, but please note that this project is released with a [Contributor Code of Conduct](https://github.com/vue-r/vueR/blob/master/CONDUCT.md). By participating in this project you agree to abide by its terms.