Skip to content

Commit cdf6668

Browse files
committed
Polishing JS
1 parent 1f00f68 commit cdf6668

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/vue_on_rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module VueOnRails
2-
VERSION = '0.9.7'
2+
VERSION = '0.9.8'
33
end

vendor/assets/javascripts/vue_on_rails.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@ this.VueOnRails = (function() {
1818
};
1919

2020
mountComponent = function(component) {
21-
var el, name, props, vm;
22-
name = component.getAttribute('data-vue-component');
23-
props = JSON.parse(component.getAttribute('data-vue-props'));
21+
var name = component.getAttribute('data-vue-component');
22+
var props = JSON.parse(component.getAttribute('data-vue-props'));
2423
if ((namespace && typeof window[namespace][name] === 'object') || window[name] === 'object') {
25-
vm = newVueInstance(name, props, component);
24+
var vm = newVueInstance(name, props, component);
2625
return vueModels.push(vm);
2726
}
2827
};
2928

3029
newVueInstance = function(name, props, component) {
30+
var componentObj = {};
3131
var nameFormatted = camelCaseToHyphen(name);
3232
var element = document.createElement(nameFormatted);
3333
var componentName = namespace ? window[namespace][name] : window[name];
3434
setElementProps(element, props);
3535
component.innerHTML = '';
3636
component.appendChild(element);
37-
componentObj = {};
3837
componentObj[nameFormatted] = componentName;
3938
return new Vue({
4039
el: component,

0 commit comments

Comments
 (0)