vuejs 1.1.0.beta2 → 1.1.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -12
- data/app/helpers/syntax_helper.rb +9 -0
- data/lib/generators/generator_templates/packs/index.js +2 -1
- data/lib/generators/generator_templates/packs/index.vue +1 -1
- data/lib/generators/generator_templates/sfc/single-file-component.vue +3 -2
- data/lib/generators/vue/vue_generator.rb +2 -2
- data/lib/vuejs/version.rb +1 -1
- data/vendor/assets/javascripts/vue-on-rails.js +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f07a96eab9a53f20b80be71ef9672976e39834c236da04dd301b0799948ff0c3
|
4
|
+
data.tar.gz: 48e4f7f78174ceb061fa12740328ffb593a5bc883e5225b826a454047b8516c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '083aaa02c9684dfff34398a87c4ce5d8e1d75df8bf1068de6bfe48477d61a25b79a3dd210da0ff728739a334a25dc366f6a67d823a2e29c9587d5fb3d52d9ba0'
|
7
|
+
data.tar.gz: b68683e49d0760853c1a3bd97c7d9ee1a95f87c18807f83c081c4ec9ee7687874cede8029ce87be37d2f244870e1239b1a5275e219065d5c01a781b17a209fbc
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Vuejs Gem
|
1
|
+
# Welcome to Vuejs Gem
|
2
2
|
|
3
3
|
> Vue for your favourite Ruby on Rails projects
|
4
4
|
|
@@ -26,9 +26,18 @@ And then execute:
|
|
26
26
|
|
27
27
|
$ bundle
|
28
28
|
|
29
|
-
|
29
|
+
## Get started
|
30
30
|
|
31
|
-
|
31
|
+
To generate an empty Vue on Rails project with all its dependencies, run Rails with its application template
|
32
|
+
|
33
|
+
```
|
34
|
+
rails new app -m http://vueonrails.com/vue
|
35
|
+
```
|
36
|
+
|
37
|
+
To browse the application template, it's here http://vueonrails.com/vue
|
38
|
+
|
39
|
+
|
40
|
+
## Generate a new Vue component
|
32
41
|
|
33
42
|
```
|
34
43
|
rails generate vue something
|
@@ -36,17 +45,18 @@ rails generate vue something
|
|
36
45
|
|
37
46
|
Note: `vuejs` gem creates vue components as single-file component by default.
|
38
47
|
|
39
|
-
To generate a component with seperation of concern, please use the `--seperate
|
48
|
+
To generate a component with seperation of concern, please use the option `--seperate`,
|
49
|
+
like `rails g vue something --seperate`
|
40
50
|
|
41
51
|
> rails g vue something --seperate
|
42
52
|
|
43
|
-
## Vue component
|
53
|
+
## Destroy a Vue component
|
44
54
|
|
45
55
|
```
|
46
56
|
rails destroy vue something
|
47
57
|
```
|
48
58
|
|
49
|
-
## Vue component
|
59
|
+
## View a standalone Vue component
|
50
60
|
|
51
61
|
Vue-component viewer allows you to browse your individual & independent Vue component easily without its surrounding element outside the scope of the component. Simply visit http://localhost:3000/vue/<name>
|
52
62
|
|
@@ -55,26 +65,25 @@ To mount the endpoint `/vue/<name>`, go to routes.rb and paste this:
|
|
55
65
|
```
|
56
66
|
mount Vuejs::engine, to: 'vue'
|
57
67
|
```
|
58
|
-
|
68
|
+
|
69
|
+
## Generate a Vue component with Turbolinks support
|
59
70
|
```
|
60
71
|
rails generate vue something --turbolinks
|
61
72
|
```
|
62
73
|
|
63
|
-
##
|
74
|
+
## Generate a Vue component with Vuex support
|
64
75
|
|
65
76
|
```
|
66
77
|
rails generate vue something --vuex
|
67
78
|
```
|
68
79
|
|
69
|
-
|
70
|
-
|
71
|
-
## Enable Specific page vue
|
80
|
+
## Generate a Vue component with Specific Page Vue support
|
72
81
|
|
73
82
|
```
|
74
83
|
rails generate vue something --spv
|
75
84
|
```
|
76
85
|
|
77
|
-
|
86
|
+
## Generate a Vue component with unit tests
|
78
87
|
|
79
88
|
```
|
80
89
|
rails generate vue something --test
|
@@ -15,6 +15,15 @@ module SyntaxHelper
|
|
15
15
|
"<p>#{Vuejs::VERSION}</p>".html_safe
|
16
16
|
end
|
17
17
|
|
18
|
+
def vue_component(identifier, variable)
|
19
|
+
concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe)
|
20
|
+
concat("</div>".html_safe)
|
21
|
+
variable.each {|key, value|
|
22
|
+
concat("<div id=\"vueonrails-#{key}\" data-#{key}=\"#{value}\">".html_safe)
|
23
|
+
concat("</div>".html_safe)
|
24
|
+
}; nil
|
25
|
+
end
|
26
|
+
|
18
27
|
def vue(identifier)
|
19
28
|
concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe)
|
20
29
|
yield
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<template>
|
4
4
|
<div id="app">
|
5
5
|
<p>{{ message }}</p>
|
6
|
-
<button @click="
|
6
|
+
<button @click="onClick">click this</button>
|
7
7
|
</div>
|
8
8
|
</template>
|
9
9
|
|
@@ -20,7 +20,8 @@ export default {
|
|
20
20
|
}
|
21
21
|
},
|
22
22
|
methods: {
|
23
|
-
|
23
|
+
onClick: function(response){
|
24
|
+
alert("clicked")
|
24
25
|
console.log("clicked")
|
25
26
|
}
|
26
27
|
},
|
@@ -63,7 +63,7 @@ class VueGenerator < Rails::Generators::NamedBase
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def create_component_with_seperate_concern_using name
|
66
|
-
say "
|
66
|
+
say "Generated a Vue component with seperation of concern"
|
67
67
|
@code = "<%= vue \"#{name}\" %>"
|
68
68
|
template "packs/pack.js.erb", "#{PACKS_PATH}/#{name}.js"
|
69
69
|
template "packs/index.vue", "#{PARTS_PATH}/#{name}/#{name}.vue"
|
@@ -72,7 +72,7 @@ class VueGenerator < Rails::Generators::NamedBase
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def create_single_file_component_using name
|
75
|
-
say "
|
75
|
+
say "Generated a Single File Component"
|
76
76
|
@code = "<%= vue \"#{name}\" %>"
|
77
77
|
template "packs/pack.js.erb", "#{PACKS_PATH}/#{name}.js"
|
78
78
|
template "sfc/single-file-component.vue", "#{PARTS_PATH}/#{name}.vue"
|
data/lib/vuejs/version.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
function erb(variable){
|
2
|
+
return document.getElementById("vueonrails-" + variable).getAttribute("data-" + variable)
|
3
|
+
}
|
4
|
+
|
1
5
|
function isView(pageClassString){
|
2
6
|
if(pageClassString == "###") return
|
3
7
|
if(pageClassString != "") pageClassString = pageClassString.replace(/#/g , " ");
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vuejs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.
|
4
|
+
version: 1.1.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Lim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|