vue-rails 2.2.1 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +2 -1
- data/lib/vue-rails/version.rb +1 -1
- data/vendor/assets/javascripts/vue.js +355 -287
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b68a092d2307324763c57de2cdd822abd5b78a4
|
4
|
+
data.tar.gz: 28e88d682259d381484b14ebef2676419726ccff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a56153ee8da3a34004054186b79a70eb473225fe22462aa3cf6a1ae221a5f111101539693c98f7846a22439bac61be1597b0b5542bf92c0c9030ad0fe3c22ee6
|
7
|
+
data.tar.gz: 72591f15195d02d6c6ddf76605ec2b91241ff38462d269ffb3bc2e9978d9cfb7bd7302c29b7ea04602893a77ec432d08f7bfaa47cd9b8e87f06b866e87dd5e0c
|
data/Readme.md
CHANGED
@@ -11,7 +11,7 @@ Rails 3.1+ asset-pipeline gem to provide Vue.js
|
|
11
11
|
|
12
12
|
### Package Versions
|
13
13
|
|
14
|
-
- vue v2.2.
|
14
|
+
- vue v2.2.4
|
15
15
|
- vue-router v2.2.1
|
16
16
|
- vue-resource v1.2.1
|
17
17
|
- vuex v2.2.1
|
@@ -35,6 +35,7 @@ And in your application.js manifest:
|
|
35
35
|
//= require vue
|
36
36
|
//= require vue-router (optional)
|
37
37
|
//= require vue-resource (optional)
|
38
|
+
//= require vuex (optional)
|
38
39
|
```
|
39
40
|
|
40
41
|
If your `application.js` requires TurboLinks (a default setting for new Rails apps), you should strongly consider disabling it, as it will cause pages to load without reloading the Javascript.
|
data/lib/vue-rails/version.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
/*!
|
2
|
-
* Vue.js v2.2.
|
2
|
+
* Vue.js v2.2.4
|
3
3
|
* (c) 2014-2017 Evan You
|
4
4
|
* Released under the MIT License.
|
5
5
|
*/
|
6
6
|
(function (global, factory) {
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
9
|
+
(global.Vue = factory());
|
10
10
|
}(this, (function () { 'use strict';
|
11
11
|
|
12
12
|
/* */
|
@@ -222,7 +222,12 @@ function looseEqual (a, b) {
|
|
222
222
|
var isObjectA = isObject(a);
|
223
223
|
var isObjectB = isObject(b);
|
224
224
|
if (isObjectA && isObjectB) {
|
225
|
-
|
225
|
+
try {
|
226
|
+
return JSON.stringify(a) === JSON.stringify(b)
|
227
|
+
} catch (e) {
|
228
|
+
// possible circular reference
|
229
|
+
return a === b
|
230
|
+
}
|
226
231
|
} else if (!isObjectA && !isObjectB) {
|
227
232
|
return String(a) === String(b)
|
228
233
|
} else {
|
@@ -276,7 +281,7 @@ var config = {
|
|
276
281
|
/**
|
277
282
|
* Whether to record perf
|
278
283
|
*/
|
279
|
-
performance:
|
284
|
+
performance: false,
|
280
285
|
|
281
286
|
/**
|
282
287
|
* Error handler for watcher errors
|
@@ -352,6 +357,48 @@ var config = {
|
|
352
357
|
_maxUpdateCount: 100
|
353
358
|
};
|
354
359
|
|
360
|
+
/* */
|
361
|
+
|
362
|
+
var emptyObject = Object.freeze({});
|
363
|
+
|
364
|
+
/**
|
365
|
+
* Check if a string starts with $ or _
|
366
|
+
*/
|
367
|
+
function isReserved (str) {
|
368
|
+
var c = (str + '').charCodeAt(0);
|
369
|
+
return c === 0x24 || c === 0x5F
|
370
|
+
}
|
371
|
+
|
372
|
+
/**
|
373
|
+
* Define a property.
|
374
|
+
*/
|
375
|
+
function def (obj, key, val, enumerable) {
|
376
|
+
Object.defineProperty(obj, key, {
|
377
|
+
value: val,
|
378
|
+
enumerable: !!enumerable,
|
379
|
+
writable: true,
|
380
|
+
configurable: true
|
381
|
+
});
|
382
|
+
}
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Parse simple path.
|
386
|
+
*/
|
387
|
+
var bailRE = /[^\w.$]/;
|
388
|
+
function parsePath (path) {
|
389
|
+
if (bailRE.test(path)) {
|
390
|
+
return
|
391
|
+
}
|
392
|
+
var segments = path.split('.');
|
393
|
+
return function (obj) {
|
394
|
+
for (var i = 0; i < segments.length; i++) {
|
395
|
+
if (!obj) { return }
|
396
|
+
obj = obj[segments[i]];
|
397
|
+
}
|
398
|
+
return obj
|
399
|
+
}
|
400
|
+
}
|
401
|
+
|
355
402
|
/* */
|
356
403
|
/* globals MutationObserver */
|
357
404
|
|
@@ -501,58 +548,6 @@ if (typeof Set !== 'undefined' && isNative(Set)) {
|
|
501
548
|
}());
|
502
549
|
}
|
503
550
|
|
504
|
-
var perf;
|
505
|
-
|
506
|
-
{
|
507
|
-
perf = inBrowser && window.performance;
|
508
|
-
if (perf && (!perf.mark || !perf.measure)) {
|
509
|
-
perf = undefined;
|
510
|
-
}
|
511
|
-
}
|
512
|
-
|
513
|
-
/* */
|
514
|
-
|
515
|
-
var emptyObject = Object.freeze({});
|
516
|
-
|
517
|
-
/**
|
518
|
-
* Check if a string starts with $ or _
|
519
|
-
*/
|
520
|
-
function isReserved (str) {
|
521
|
-
var c = (str + '').charCodeAt(0);
|
522
|
-
return c === 0x24 || c === 0x5F
|
523
|
-
}
|
524
|
-
|
525
|
-
/**
|
526
|
-
* Define a property.
|
527
|
-
*/
|
528
|
-
function def (obj, key, val, enumerable) {
|
529
|
-
Object.defineProperty(obj, key, {
|
530
|
-
value: val,
|
531
|
-
enumerable: !!enumerable,
|
532
|
-
writable: true,
|
533
|
-
configurable: true
|
534
|
-
});
|
535
|
-
}
|
536
|
-
|
537
|
-
/**
|
538
|
-
* Parse simple path.
|
539
|
-
*/
|
540
|
-
var bailRE = /[^\w.$]/;
|
541
|
-
function parsePath (path) {
|
542
|
-
if (bailRE.test(path)) {
|
543
|
-
return
|
544
|
-
} else {
|
545
|
-
var segments = path.split('.');
|
546
|
-
return function (obj) {
|
547
|
-
for (var i = 0; i < segments.length; i++) {
|
548
|
-
if (!obj) { return }
|
549
|
-
obj = obj[segments[i]];
|
550
|
-
}
|
551
|
-
return obj
|
552
|
-
}
|
553
|
-
}
|
554
|
-
}
|
555
|
-
|
556
551
|
var warn = noop;
|
557
552
|
var tip = noop;
|
558
553
|
var formatComponentName;
|
@@ -584,9 +579,11 @@ var formatComponentName;
|
|
584
579
|
if (vm.$root === vm) {
|
585
580
|
return '<Root>'
|
586
581
|
}
|
587
|
-
var name = vm.
|
588
|
-
? vm
|
589
|
-
: vm.
|
582
|
+
var name = typeof vm === 'function' && vm.options
|
583
|
+
? vm.options.name
|
584
|
+
: vm._isVue
|
585
|
+
? vm.$options.name || vm.$options._componentTag
|
586
|
+
: vm.name;
|
590
587
|
|
591
588
|
var file = vm._isVue && vm.$options.__file;
|
592
589
|
if (!name && file) {
|
@@ -637,7 +634,7 @@ Dep.prototype.depend = function depend () {
|
|
637
634
|
};
|
638
635
|
|
639
636
|
Dep.prototype.notify = function notify () {
|
640
|
-
//
|
637
|
+
// stabilize the subscriber list first
|
641
638
|
var subs = this.subs.slice();
|
642
639
|
for (var i = 0, l = subs.length; i < l; i++) {
|
643
640
|
subs[i].update();
|
@@ -880,27 +877,27 @@ function defineReactive$$1 (
|
|
880
877
|
* triggers change notification if the property doesn't
|
881
878
|
* already exist.
|
882
879
|
*/
|
883
|
-
function set (
|
884
|
-
if (Array.isArray(
|
885
|
-
|
886
|
-
|
880
|
+
function set (target, key, val) {
|
881
|
+
if (Array.isArray(target)) {
|
882
|
+
target.length = Math.max(target.length, key);
|
883
|
+
target.splice(key, 1, val);
|
887
884
|
return val
|
888
885
|
}
|
889
|
-
if (hasOwn(
|
890
|
-
|
891
|
-
return
|
886
|
+
if (hasOwn(target, key)) {
|
887
|
+
target[key] = val;
|
888
|
+
return val
|
892
889
|
}
|
893
|
-
var ob =
|
894
|
-
if (
|
890
|
+
var ob = target.__ob__;
|
891
|
+
if (target._isVue || (ob && ob.vmCount)) {
|
895
892
|
"development" !== 'production' && warn(
|
896
893
|
'Avoid adding reactive properties to a Vue instance or its root $data ' +
|
897
894
|
'at runtime - declare it upfront in the data option.'
|
898
895
|
);
|
899
|
-
return
|
896
|
+
return val
|
900
897
|
}
|
901
898
|
if (!ob) {
|
902
|
-
|
903
|
-
return
|
899
|
+
target[key] = val;
|
900
|
+
return val
|
904
901
|
}
|
905
902
|
defineReactive$$1(ob.value, key, val);
|
906
903
|
ob.dep.notify();
|
@@ -910,23 +907,23 @@ function set (obj, key, val) {
|
|
910
907
|
/**
|
911
908
|
* Delete a property and trigger change if necessary.
|
912
909
|
*/
|
913
|
-
function del (
|
914
|
-
if (Array.isArray(
|
915
|
-
|
910
|
+
function del (target, key) {
|
911
|
+
if (Array.isArray(target)) {
|
912
|
+
target.splice(key, 1);
|
916
913
|
return
|
917
914
|
}
|
918
|
-
var ob =
|
919
|
-
if (
|
915
|
+
var ob = target.__ob__;
|
916
|
+
if (target._isVue || (ob && ob.vmCount)) {
|
920
917
|
"development" !== 'production' && warn(
|
921
918
|
'Avoid deleting properties on a Vue instance or its root $data ' +
|
922
919
|
'- just set it to null.'
|
923
920
|
);
|
924
921
|
return
|
925
922
|
}
|
926
|
-
if (!hasOwn(
|
923
|
+
if (!hasOwn(target, key)) {
|
927
924
|
return
|
928
925
|
}
|
929
|
-
delete
|
926
|
+
delete target[key];
|
930
927
|
if (!ob) {
|
931
928
|
return
|
932
929
|
}
|
@@ -1442,12 +1439,12 @@ function isType (type, fn) {
|
|
1442
1439
|
return false
|
1443
1440
|
}
|
1444
1441
|
|
1445
|
-
function handleError (err, vm,
|
1442
|
+
function handleError (err, vm, info) {
|
1446
1443
|
if (config.errorHandler) {
|
1447
|
-
config.errorHandler.call(null, err, vm,
|
1444
|
+
config.errorHandler.call(null, err, vm, info);
|
1448
1445
|
} else {
|
1449
1446
|
{
|
1450
|
-
warn(("Error in " +
|
1447
|
+
warn(("Error in " + info + ":"), vm);
|
1451
1448
|
}
|
1452
1449
|
/* istanbul ignore else */
|
1453
1450
|
if (inBrowser && typeof console !== 'undefined') {
|
@@ -1532,6 +1529,29 @@ var initProxy;
|
|
1532
1529
|
};
|
1533
1530
|
}
|
1534
1531
|
|
1532
|
+
var mark;
|
1533
|
+
var measure;
|
1534
|
+
|
1535
|
+
{
|
1536
|
+
var perf = inBrowser && window.performance;
|
1537
|
+
/* istanbul ignore if */
|
1538
|
+
if (
|
1539
|
+
perf &&
|
1540
|
+
perf.mark &&
|
1541
|
+
perf.measure &&
|
1542
|
+
perf.clearMarks &&
|
1543
|
+
perf.clearMeasures
|
1544
|
+
) {
|
1545
|
+
mark = function (tag) { return perf.mark(tag); };
|
1546
|
+
measure = function (name, startTag, endTag) {
|
1547
|
+
perf.measure(name, startTag, endTag);
|
1548
|
+
perf.clearMarks(startTag);
|
1549
|
+
perf.clearMarks(endTag);
|
1550
|
+
perf.clearMeasures(name);
|
1551
|
+
};
|
1552
|
+
}
|
1553
|
+
}
|
1554
|
+
|
1535
1555
|
/* */
|
1536
1556
|
|
1537
1557
|
var VNode = function VNode (
|
@@ -1606,8 +1626,9 @@ function cloneVNode (vnode) {
|
|
1606
1626
|
}
|
1607
1627
|
|
1608
1628
|
function cloneVNodes (vnodes) {
|
1609
|
-
var
|
1610
|
-
|
1629
|
+
var len = vnodes.length;
|
1630
|
+
var res = new Array(len);
|
1631
|
+
for (var i = 0; i < len; i++) {
|
1611
1632
|
res[i] = cloneVNode(vnodes[i]);
|
1612
1633
|
}
|
1613
1634
|
return res
|
@@ -1735,7 +1756,7 @@ function simpleNormalizeChildren (children) {
|
|
1735
1756
|
return children
|
1736
1757
|
}
|
1737
1758
|
|
1738
|
-
// 2. When the children contains
|
1759
|
+
// 2. When the children contains constructs that always generated nested Arrays,
|
1739
1760
|
// e.g. <template>, <slot>, v-for, or when the children is provided by user
|
1740
1761
|
// with hand-written render functions / JSX. In such cases a full normalization
|
1741
1762
|
// is needed to cater to all possible types of children values.
|
@@ -1853,12 +1874,21 @@ function eventsMixin (Vue) {
|
|
1853
1874
|
};
|
1854
1875
|
|
1855
1876
|
Vue.prototype.$off = function (event, fn) {
|
1877
|
+
var this$1 = this;
|
1878
|
+
|
1856
1879
|
var vm = this;
|
1857
1880
|
// all
|
1858
1881
|
if (!arguments.length) {
|
1859
1882
|
vm._events = Object.create(null);
|
1860
1883
|
return vm
|
1861
1884
|
}
|
1885
|
+
// array of events
|
1886
|
+
if (Array.isArray(event)) {
|
1887
|
+
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
|
1888
|
+
this$1.$off(event[i$1], fn);
|
1889
|
+
}
|
1890
|
+
return vm
|
1891
|
+
}
|
1862
1892
|
// specific event
|
1863
1893
|
var cbs = vm._events[event];
|
1864
1894
|
if (!cbs) {
|
@@ -1926,16 +1956,17 @@ function resolveSlots (
|
|
1926
1956
|
defaultSlot.push(child);
|
1927
1957
|
}
|
1928
1958
|
}
|
1929
|
-
// ignore
|
1930
|
-
if (defaultSlot.
|
1931
|
-
defaultSlot.length === 1 &&
|
1932
|
-
(defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
|
1933
|
-
)) {
|
1959
|
+
// ignore whitespace
|
1960
|
+
if (!defaultSlot.every(isWhitespace)) {
|
1934
1961
|
slots.default = defaultSlot;
|
1935
1962
|
}
|
1936
1963
|
return slots
|
1937
1964
|
}
|
1938
1965
|
|
1966
|
+
function isWhitespace (node) {
|
1967
|
+
return node.isComment || node.text === ' '
|
1968
|
+
}
|
1969
|
+
|
1939
1970
|
function resolveScopedSlots (
|
1940
1971
|
fns
|
1941
1972
|
) {
|
@@ -2072,10 +2103,11 @@ function mountComponent (
|
|
2072
2103
|
vm.$options.render = createEmptyVNode;
|
2073
2104
|
{
|
2074
2105
|
/* istanbul ignore if */
|
2075
|
-
if (vm.$options.template && vm.$options.template.charAt(0) !== '#')
|
2106
|
+
if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
|
2107
|
+
vm.$options.el || el) {
|
2076
2108
|
warn(
|
2077
2109
|
'You are using the runtime-only build of Vue where the template ' +
|
2078
|
-
'
|
2110
|
+
'compiler is not available. Either pre-compile the templates into ' +
|
2079
2111
|
'render functions, or use the compiler-included build.',
|
2080
2112
|
vm
|
2081
2113
|
);
|
@@ -2091,19 +2123,22 @@ function mountComponent (
|
|
2091
2123
|
|
2092
2124
|
var updateComponent;
|
2093
2125
|
/* istanbul ignore if */
|
2094
|
-
if ("development" !== 'production' && config.performance &&
|
2126
|
+
if ("development" !== 'production' && config.performance && mark) {
|
2095
2127
|
updateComponent = function () {
|
2096
2128
|
var name = vm._name;
|
2097
|
-
var
|
2098
|
-
var
|
2099
|
-
perf
|
2129
|
+
var id = vm._uid;
|
2130
|
+
var startTag = "vue-perf-start:" + id;
|
2131
|
+
var endTag = "vue-perf-end:" + id;
|
2132
|
+
|
2133
|
+
mark(startTag);
|
2100
2134
|
var vnode = vm._render();
|
2101
|
-
|
2102
|
-
|
2103
|
-
|
2135
|
+
mark(endTag);
|
2136
|
+
measure((name + " render"), startTag, endTag);
|
2137
|
+
|
2138
|
+
mark(startTag);
|
2104
2139
|
vm._update(vnode, hydrating);
|
2105
|
-
|
2106
|
-
|
2140
|
+
mark(endTag);
|
2141
|
+
measure((name + " patch"), startTag, endTag);
|
2107
2142
|
};
|
2108
2143
|
} else {
|
2109
2144
|
updateComponent = function () {
|
@@ -2841,8 +2876,63 @@ function stateMixin (Vue) {
|
|
2841
2876
|
|
2842
2877
|
/* */
|
2843
2878
|
|
2844
|
-
|
2845
|
-
var
|
2879
|
+
// hooks to be invoked on component VNodes during patch
|
2880
|
+
var componentVNodeHooks = {
|
2881
|
+
init: function init (
|
2882
|
+
vnode,
|
2883
|
+
hydrating,
|
2884
|
+
parentElm,
|
2885
|
+
refElm
|
2886
|
+
) {
|
2887
|
+
if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
|
2888
|
+
var child = vnode.componentInstance = createComponentInstanceForVnode(
|
2889
|
+
vnode,
|
2890
|
+
activeInstance,
|
2891
|
+
parentElm,
|
2892
|
+
refElm
|
2893
|
+
);
|
2894
|
+
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
2895
|
+
} else if (vnode.data.keepAlive) {
|
2896
|
+
// kept-alive components, treat as a patch
|
2897
|
+
var mountedNode = vnode; // work around flow
|
2898
|
+
componentVNodeHooks.prepatch(mountedNode, mountedNode);
|
2899
|
+
}
|
2900
|
+
},
|
2901
|
+
|
2902
|
+
prepatch: function prepatch (oldVnode, vnode) {
|
2903
|
+
var options = vnode.componentOptions;
|
2904
|
+
var child = vnode.componentInstance = oldVnode.componentInstance;
|
2905
|
+
updateChildComponent(
|
2906
|
+
child,
|
2907
|
+
options.propsData, // updated props
|
2908
|
+
options.listeners, // updated listeners
|
2909
|
+
vnode, // new parent vnode
|
2910
|
+
options.children // new children
|
2911
|
+
);
|
2912
|
+
},
|
2913
|
+
|
2914
|
+
insert: function insert (vnode) {
|
2915
|
+
if (!vnode.componentInstance._isMounted) {
|
2916
|
+
vnode.componentInstance._isMounted = true;
|
2917
|
+
callHook(vnode.componentInstance, 'mounted');
|
2918
|
+
}
|
2919
|
+
if (vnode.data.keepAlive) {
|
2920
|
+
activateChildComponent(vnode.componentInstance, true /* direct */);
|
2921
|
+
}
|
2922
|
+
},
|
2923
|
+
|
2924
|
+
destroy: function destroy (vnode) {
|
2925
|
+
if (!vnode.componentInstance._isDestroyed) {
|
2926
|
+
if (!vnode.data.keepAlive) {
|
2927
|
+
vnode.componentInstance.$destroy();
|
2928
|
+
} else {
|
2929
|
+
deactivateChildComponent(vnode.componentInstance, true /* direct */);
|
2930
|
+
}
|
2931
|
+
}
|
2932
|
+
}
|
2933
|
+
};
|
2934
|
+
|
2935
|
+
var hooksToMerge = Object.keys(componentVNodeHooks);
|
2846
2936
|
|
2847
2937
|
function createComponent (
|
2848
2938
|
Ctor,
|
@@ -2990,62 +3080,6 @@ function createComponentInstanceForVnode (
|
|
2990
3080
|
return new vnodeComponentOptions.Ctor(options)
|
2991
3081
|
}
|
2992
3082
|
|
2993
|
-
function init (
|
2994
|
-
vnode,
|
2995
|
-
hydrating,
|
2996
|
-
parentElm,
|
2997
|
-
refElm
|
2998
|
-
) {
|
2999
|
-
if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
|
3000
|
-
var child = vnode.componentInstance = createComponentInstanceForVnode(
|
3001
|
-
vnode,
|
3002
|
-
activeInstance,
|
3003
|
-
parentElm,
|
3004
|
-
refElm
|
3005
|
-
);
|
3006
|
-
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
3007
|
-
} else if (vnode.data.keepAlive) {
|
3008
|
-
// kept-alive components, treat as a patch
|
3009
|
-
var mountedNode = vnode; // work around flow
|
3010
|
-
prepatch(mountedNode, mountedNode);
|
3011
|
-
}
|
3012
|
-
}
|
3013
|
-
|
3014
|
-
function prepatch (
|
3015
|
-
oldVnode,
|
3016
|
-
vnode
|
3017
|
-
) {
|
3018
|
-
var options = vnode.componentOptions;
|
3019
|
-
var child = vnode.componentInstance = oldVnode.componentInstance;
|
3020
|
-
updateChildComponent(
|
3021
|
-
child,
|
3022
|
-
options.propsData, // updated props
|
3023
|
-
options.listeners, // updated listeners
|
3024
|
-
vnode, // new parent vnode
|
3025
|
-
options.children // new children
|
3026
|
-
);
|
3027
|
-
}
|
3028
|
-
|
3029
|
-
function insert (vnode) {
|
3030
|
-
if (!vnode.componentInstance._isMounted) {
|
3031
|
-
vnode.componentInstance._isMounted = true;
|
3032
|
-
callHook(vnode.componentInstance, 'mounted');
|
3033
|
-
}
|
3034
|
-
if (vnode.data.keepAlive) {
|
3035
|
-
activateChildComponent(vnode.componentInstance, true /* direct */);
|
3036
|
-
}
|
3037
|
-
}
|
3038
|
-
|
3039
|
-
function destroy (vnode) {
|
3040
|
-
if (!vnode.componentInstance._isDestroyed) {
|
3041
|
-
if (!vnode.data.keepAlive) {
|
3042
|
-
vnode.componentInstance.$destroy();
|
3043
|
-
} else {
|
3044
|
-
deactivateChildComponent(vnode.componentInstance, true /* direct */);
|
3045
|
-
}
|
3046
|
-
}
|
3047
|
-
}
|
3048
|
-
|
3049
3083
|
function resolveAsyncComponent (
|
3050
3084
|
factory,
|
3051
3085
|
baseCtor,
|
@@ -3109,6 +3143,21 @@ function extractProps (data, Ctor) {
|
|
3109
3143
|
if (attrs || props || domProps) {
|
3110
3144
|
for (var key in propOptions) {
|
3111
3145
|
var altKey = hyphenate(key);
|
3146
|
+
{
|
3147
|
+
var keyInLowerCase = key.toLowerCase();
|
3148
|
+
if (
|
3149
|
+
key !== keyInLowerCase &&
|
3150
|
+
attrs && attrs.hasOwnProperty(keyInLowerCase)
|
3151
|
+
) {
|
3152
|
+
warn(
|
3153
|
+
"Prop \"" + keyInLowerCase + "\" is not declared in component " +
|
3154
|
+
(formatComponentName(Ctor)) + ". Note that HTML attributes are " +
|
3155
|
+
"case-insensitive and camelCased props need to use their kebab-case " +
|
3156
|
+
"equivalents when using in-DOM templates. You should probably use " +
|
3157
|
+
"\"" + altKey + "\" instead of \"" + key + "\"."
|
3158
|
+
);
|
3159
|
+
}
|
3160
|
+
}
|
3112
3161
|
checkProp(res, props, key, altKey, true) ||
|
3113
3162
|
checkProp(res, attrs, key, altKey) ||
|
3114
3163
|
checkProp(res, domProps, key, altKey);
|
@@ -3149,7 +3198,7 @@ function mergeHooks (data) {
|
|
3149
3198
|
for (var i = 0; i < hooksToMerge.length; i++) {
|
3150
3199
|
var key = hooksToMerge[i];
|
3151
3200
|
var fromParent = data.hook[key];
|
3152
|
-
var ours =
|
3201
|
+
var ours = componentVNodeHooks[key];
|
3153
3202
|
data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
|
3154
3203
|
}
|
3155
3204
|
}
|
@@ -3391,14 +3440,17 @@ function bindObjectProps (
|
|
3391
3440
|
if (Array.isArray(value)) {
|
3392
3441
|
value = toObject(value);
|
3393
3442
|
}
|
3443
|
+
var hash;
|
3394
3444
|
for (var key in value) {
|
3395
3445
|
if (key === 'class' || key === 'style') {
|
3396
|
-
|
3446
|
+
hash = data;
|
3397
3447
|
} else {
|
3398
3448
|
var type = data.attrs && data.attrs.type;
|
3399
|
-
|
3449
|
+
hash = asProp || config.mustUseProp(tag, type, key)
|
3400
3450
|
? data.domProps || (data.domProps = {})
|
3401
3451
|
: data.attrs || (data.attrs = {});
|
3452
|
+
}
|
3453
|
+
if (!(key in hash)) {
|
3402
3454
|
hash[key] = value[key];
|
3403
3455
|
}
|
3404
3456
|
}
|
@@ -3565,14 +3617,17 @@ function renderMixin (Vue) {
|
|
3565
3617
|
|
3566
3618
|
/* */
|
3567
3619
|
|
3568
|
-
function
|
3620
|
+
function initProvide (vm) {
|
3569
3621
|
var provide = vm.$options.provide;
|
3570
|
-
var inject = vm.$options.inject;
|
3571
3622
|
if (provide) {
|
3572
3623
|
vm._provided = typeof provide === 'function'
|
3573
3624
|
? provide.call(vm)
|
3574
3625
|
: provide;
|
3575
3626
|
}
|
3627
|
+
}
|
3628
|
+
|
3629
|
+
function initInjections (vm) {
|
3630
|
+
var inject = vm.$options.inject;
|
3576
3631
|
if (inject) {
|
3577
3632
|
// inject is :any because flow is not smart enough to figure out cached
|
3578
3633
|
// isArray here
|
@@ -3588,7 +3643,7 @@ function initInjections (vm) {
|
|
3588
3643
|
var provideKey = isArray ? key : inject[key];
|
3589
3644
|
var source = vm;
|
3590
3645
|
while (source) {
|
3591
|
-
if (source._provided && source._provided
|
3646
|
+
if (source._provided && provideKey in source._provided) {
|
3592
3647
|
vm[key] = source._provided[provideKey];
|
3593
3648
|
break
|
3594
3649
|
}
|
@@ -3605,8 +3660,8 @@ var uid = 0;
|
|
3605
3660
|
function initMixin (Vue) {
|
3606
3661
|
Vue.prototype._init = function (options) {
|
3607
3662
|
/* istanbul ignore if */
|
3608
|
-
if ("development" !== 'production' && config.performance &&
|
3609
|
-
|
3663
|
+
if ("development" !== 'production' && config.performance && mark) {
|
3664
|
+
mark('vue-perf-init');
|
3610
3665
|
}
|
3611
3666
|
|
3612
3667
|
var vm = this;
|
@@ -3637,15 +3692,16 @@ function initMixin (Vue) {
|
|
3637
3692
|
initEvents(vm);
|
3638
3693
|
initRender(vm);
|
3639
3694
|
callHook(vm, 'beforeCreate');
|
3695
|
+
initInjections(vm); // resolve injections before data/props
|
3640
3696
|
initState(vm);
|
3641
|
-
|
3697
|
+
initProvide(vm); // resolve provide after data/props
|
3642
3698
|
callHook(vm, 'created');
|
3643
3699
|
|
3644
3700
|
/* istanbul ignore if */
|
3645
|
-
if ("development" !== 'production' && config.performance &&
|
3701
|
+
if ("development" !== 'production' && config.performance && mark) {
|
3646
3702
|
vm._name = formatComponentName(vm, false);
|
3647
|
-
|
3648
|
-
|
3703
|
+
mark('vue-perf-init-end');
|
3704
|
+
measure(((vm._name) + " init"), 'vue-perf-init', 'vue-perf-init-end');
|
3649
3705
|
}
|
3650
3706
|
|
3651
3707
|
if (vm.$options.el) {
|
@@ -4057,7 +4113,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
|
|
4057
4113
|
get: isServerRendering
|
4058
4114
|
});
|
4059
4115
|
|
4060
|
-
Vue$3.version = '2.2.
|
4116
|
+
Vue$3.version = '2.2.4';
|
4061
4117
|
|
4062
4118
|
/* */
|
4063
4119
|
|
@@ -4322,18 +4378,18 @@ function setAttribute (node, key, val) {
|
|
4322
4378
|
|
4323
4379
|
|
4324
4380
|
var nodeOps = Object.freeze({
|
4325
|
-
|
4326
|
-
|
4327
|
-
|
4328
|
-
|
4329
|
-
|
4330
|
-
|
4331
|
-
|
4332
|
-
|
4333
|
-
|
4334
|
-
|
4335
|
-
|
4336
|
-
|
4381
|
+
createElement: createElement$1,
|
4382
|
+
createElementNS: createElementNS,
|
4383
|
+
createTextNode: createTextNode,
|
4384
|
+
createComment: createComment,
|
4385
|
+
insertBefore: insertBefore,
|
4386
|
+
removeChild: removeChild,
|
4387
|
+
appendChild: appendChild,
|
4388
|
+
parentNode: parentNode,
|
4389
|
+
nextSibling: nextSibling,
|
4390
|
+
tagName: tagName,
|
4391
|
+
setTextContent: setTextContent,
|
4392
|
+
setAttribute: setAttribute
|
4337
4393
|
});
|
4338
4394
|
|
4339
4395
|
/* */
|
@@ -4395,7 +4451,7 @@ function registerRef (vnode, isRemoval) {
|
|
4395
4451
|
|
4396
4452
|
var emptyNode = new VNode('', {}, []);
|
4397
4453
|
|
4398
|
-
var hooks
|
4454
|
+
var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
|
4399
4455
|
|
4400
4456
|
function isUndef (s) {
|
4401
4457
|
return s == null
|
@@ -4431,10 +4487,10 @@ function createPatchFunction (backend) {
|
|
4431
4487
|
var modules = backend.modules;
|
4432
4488
|
var nodeOps = backend.nodeOps;
|
4433
4489
|
|
4434
|
-
for (i = 0; i < hooks
|
4435
|
-
cbs[hooks
|
4490
|
+
for (i = 0; i < hooks.length; ++i) {
|
4491
|
+
cbs[hooks[i]] = [];
|
4436
4492
|
for (j = 0; j < modules.length; ++j) {
|
4437
|
-
if (modules[j][hooks
|
4493
|
+
if (modules[j][hooks[i]] !== undefined) { cbs[hooks[i]].push(modules[j][hooks[i]]); }
|
4438
4494
|
}
|
4439
4495
|
}
|
4440
4496
|
|
@@ -5436,6 +5492,7 @@ function genComponentModel (
|
|
5436
5492
|
|
5437
5493
|
el.model = {
|
5438
5494
|
value: ("(" + value + ")"),
|
5495
|
+
expression: ("\"" + value + "\""),
|
5439
5496
|
callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
|
5440
5497
|
};
|
5441
5498
|
}
|
@@ -5615,14 +5672,6 @@ function genCheckboxModel (
|
|
5615
5672
|
value,
|
5616
5673
|
modifiers
|
5617
5674
|
) {
|
5618
|
-
if ("development" !== 'production' &&
|
5619
|
-
el.attrsMap.checked != null) {
|
5620
|
-
warn$1(
|
5621
|
-
"<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
|
5622
|
-
"inline checked attributes will be ignored when using v-model. " +
|
5623
|
-
'Declare initial values in the component\'s data option instead.'
|
5624
|
-
);
|
5625
|
-
}
|
5626
5675
|
var number = modifiers && modifiers.number;
|
5627
5676
|
var valueBinding = getBindingAttr(el, 'value') || 'null';
|
5628
5677
|
var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
|
@@ -5654,14 +5703,6 @@ function genRadioModel (
|
|
5654
5703
|
value,
|
5655
5704
|
modifiers
|
5656
5705
|
) {
|
5657
|
-
if ("development" !== 'production' &&
|
5658
|
-
el.attrsMap.checked != null) {
|
5659
|
-
warn$1(
|
5660
|
-
"<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
|
5661
|
-
"inline checked attributes will be ignored when using v-model. " +
|
5662
|
-
'Declare initial values in the component\'s data option instead.'
|
5663
|
-
);
|
5664
|
-
}
|
5665
5706
|
var number = modifiers && modifiers.number;
|
5666
5707
|
var valueBinding = getBindingAttr(el, 'value') || 'null';
|
5667
5708
|
valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
|
@@ -5674,10 +5715,6 @@ function genSelect (
|
|
5674
5715
|
value,
|
5675
5716
|
modifiers
|
5676
5717
|
) {
|
5677
|
-
{
|
5678
|
-
el.children.some(checkOptionWarning);
|
5679
|
-
}
|
5680
|
-
|
5681
5718
|
var number = modifiers && modifiers.number;
|
5682
5719
|
var selectedVal = "Array.prototype.filter" +
|
5683
5720
|
".call($event.target.options,function(o){return o.selected})" +
|
@@ -5690,20 +5727,6 @@ function genSelect (
|
|
5690
5727
|
addHandler(el, 'change', code, null, true);
|
5691
5728
|
}
|
5692
5729
|
|
5693
|
-
function checkOptionWarning (option) {
|
5694
|
-
if (option.type === 1 &&
|
5695
|
-
option.tag === 'option' &&
|
5696
|
-
option.attrsMap.selected != null) {
|
5697
|
-
warn$1(
|
5698
|
-
"<select v-model=\"" + (option.parent.attrsMap['v-model']) + "\">:\n" +
|
5699
|
-
'inline selected attributes on <option> will be ignored when using v-model. ' +
|
5700
|
-
'Declare initial values in the component\'s data option instead.'
|
5701
|
-
);
|
5702
|
-
return true
|
5703
|
-
}
|
5704
|
-
return false
|
5705
|
-
}
|
5706
|
-
|
5707
5730
|
function genDefaultModel (
|
5708
5731
|
el,
|
5709
5732
|
value,
|
@@ -6201,9 +6224,9 @@ var transformRE = /\b(transform|all)(,|$)/;
|
|
6201
6224
|
|
6202
6225
|
function getTransitionInfo (el, expectedType) {
|
6203
6226
|
var styles = window.getComputedStyle(el);
|
6204
|
-
var
|
6227
|
+
var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
|
6205
6228
|
var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
|
6206
|
-
var transitionTimeout = getTimeout(
|
6229
|
+
var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
6207
6230
|
var animationDelays = styles[animationProp + 'Delay'].split(', ');
|
6208
6231
|
var animationDurations = styles[animationProp + 'Duration'].split(', ');
|
6209
6232
|
var animationTimeout = getTimeout(animationDelays, animationDurations);
|
@@ -6353,7 +6376,7 @@ function enter (vnode, toggleDisplay) {
|
|
6353
6376
|
}
|
6354
6377
|
|
6355
6378
|
var expectsCSS = css !== false && !isIE9;
|
6356
|
-
var userWantsControl =
|
6379
|
+
var userWantsControl = getHookArgumentsLength(enterHook);
|
6357
6380
|
|
6358
6381
|
var cb = el._enterCb = once(function () {
|
6359
6382
|
if (expectsCSS) {
|
@@ -6445,7 +6468,7 @@ function leave (vnode, rm) {
|
|
6445
6468
|
var duration = data.duration;
|
6446
6469
|
|
6447
6470
|
var expectsCSS = css !== false && !isIE9;
|
6448
|
-
var userWantsControl =
|
6471
|
+
var userWantsControl = getHookArgumentsLength(leave);
|
6449
6472
|
|
6450
6473
|
var explicitLeaveDuration = toNumber(
|
6451
6474
|
isObject(duration)
|
@@ -6542,12 +6565,12 @@ function isValidDuration (val) {
|
|
6542
6565
|
* - a wrapped component method (check ._length)
|
6543
6566
|
* - a plain function (.length)
|
6544
6567
|
*/
|
6545
|
-
function
|
6568
|
+
function getHookArgumentsLength (fn) {
|
6546
6569
|
if (!fn) { return false }
|
6547
6570
|
var invokerFns = fn.fns;
|
6548
6571
|
if (invokerFns) {
|
6549
6572
|
// invoker
|
6550
|
-
return
|
6573
|
+
return getHookArgumentsLength(
|
6551
6574
|
Array.isArray(invokerFns)
|
6552
6575
|
? invokerFns[0]
|
6553
6576
|
: invokerFns
|
@@ -6967,7 +6990,7 @@ var Transition = {
|
|
6967
6990
|
// we force transition-group to update its children into two passes:
|
6968
6991
|
// in the first pass, we remove all nodes that need to be removed,
|
6969
6992
|
// triggering their leaving transition; in the second pass, we insert/move
|
6970
|
-
// into the final
|
6993
|
+
// into the final desired state. This way in the second pass removed
|
6971
6994
|
// nodes will remain where they should be.
|
6972
6995
|
|
6973
6996
|
var props = extend({
|
@@ -7194,15 +7217,13 @@ var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', ' ') : false;
|
|
7194
7217
|
|
7195
7218
|
var isUnaryTag = makeMap(
|
7196
7219
|
'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
|
7197
|
-
'link,meta,param,source,track,wbr'
|
7198
|
-
true
|
7220
|
+
'link,meta,param,source,track,wbr'
|
7199
7221
|
);
|
7200
7222
|
|
7201
7223
|
// Elements that you can, intentionally, leave open
|
7202
7224
|
// (and which close themselves)
|
7203
7225
|
var canBeLeftOpenTag = makeMap(
|
7204
|
-
'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
|
7205
|
-
true
|
7226
|
+
'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
|
7206
7227
|
);
|
7207
7228
|
|
7208
7229
|
// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
|
@@ -7212,8 +7233,7 @@ var isNonPhrasingTag = makeMap(
|
|
7212
7233
|
'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
|
7213
7234
|
'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
|
7214
7235
|
'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
|
7215
|
-
'title,tr,track'
|
7216
|
-
true
|
7236
|
+
'title,tr,track'
|
7217
7237
|
);
|
7218
7238
|
|
7219
7239
|
/* */
|
@@ -7271,7 +7291,7 @@ var IS_REGEX_CAPTURING_BROKEN = false;
|
|
7271
7291
|
});
|
7272
7292
|
|
7273
7293
|
// Special Elements (can contain anything)
|
7274
|
-
var
|
7294
|
+
var isPlainTextElement = makeMap('script,style,textarea', true);
|
7275
7295
|
var reCache = {};
|
7276
7296
|
|
7277
7297
|
var decodingMap = {
|
@@ -7297,8 +7317,8 @@ function parseHTML (html, options) {
|
|
7297
7317
|
var last, lastTag;
|
7298
7318
|
while (html) {
|
7299
7319
|
last = html;
|
7300
|
-
// Make sure we're not in a
|
7301
|
-
if (!lastTag || !
|
7320
|
+
// Make sure we're not in a plaintext content element like script/style
|
7321
|
+
if (!lastTag || !isPlainTextElement(lastTag)) {
|
7302
7322
|
var textEnd = html.indexOf('<');
|
7303
7323
|
if (textEnd === 0) {
|
7304
7324
|
// Comment:
|
@@ -7378,7 +7398,7 @@ function parseHTML (html, options) {
|
|
7378
7398
|
var endTagLength = 0;
|
7379
7399
|
var rest = html.replace(reStackedTag, function (all, text, endTag) {
|
7380
7400
|
endTagLength = endTag.length;
|
7381
|
-
if (stackedTag
|
7401
|
+
if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
|
7382
7402
|
text = text
|
7383
7403
|
.replace(/<!--([\s\S]*?)-->/g, '$1')
|
7384
7404
|
.replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
|
@@ -7573,25 +7593,26 @@ function parseText (
|
|
7573
7593
|
|
7574
7594
|
/* */
|
7575
7595
|
|
7596
|
+
var onRE = /^@|^v-on:/;
|
7576
7597
|
var dirRE = /^v-|^@|^:/;
|
7577
7598
|
var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
|
7578
7599
|
var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
|
7579
|
-
|
7580
|
-
var onRE = /^@|^v-on:/;
|
7600
|
+
|
7581
7601
|
var argRE = /:(.*)$/;
|
7602
|
+
var bindRE = /^:|^v-bind:/;
|
7582
7603
|
var modifierRE = /\.[^.]+/g;
|
7583
7604
|
|
7584
7605
|
var decodeHTMLCached = cached(decode);
|
7585
7606
|
|
7586
7607
|
// configurable state
|
7587
7608
|
var warn$2;
|
7588
|
-
var
|
7589
|
-
var platformMustUseProp;
|
7590
|
-
var platformIsPreTag;
|
7591
|
-
var preTransforms;
|
7609
|
+
var delimiters;
|
7592
7610
|
var transforms;
|
7611
|
+
var preTransforms;
|
7593
7612
|
var postTransforms;
|
7594
|
-
var
|
7613
|
+
var platformIsPreTag;
|
7614
|
+
var platformMustUseProp;
|
7615
|
+
var platformGetTagNamespace;
|
7595
7616
|
|
7596
7617
|
/**
|
7597
7618
|
* Convert HTML string to AST.
|
@@ -7617,6 +7638,13 @@ function parse (
|
|
7617
7638
|
var inPre = false;
|
7618
7639
|
var warned = false;
|
7619
7640
|
|
7641
|
+
function warnOnce (msg) {
|
7642
|
+
if (!warned) {
|
7643
|
+
warned = true;
|
7644
|
+
warn$2(msg);
|
7645
|
+
}
|
7646
|
+
}
|
7647
|
+
|
7620
7648
|
function endPre (element) {
|
7621
7649
|
// check pre state
|
7622
7650
|
if (element.pre) {
|
@@ -7700,17 +7728,15 @@ function parse (
|
|
7700
7728
|
}
|
7701
7729
|
|
7702
7730
|
function checkRootConstraints (el) {
|
7703
|
-
|
7731
|
+
{
|
7704
7732
|
if (el.tag === 'slot' || el.tag === 'template') {
|
7705
|
-
|
7706
|
-
warn$2(
|
7733
|
+
warnOnce(
|
7707
7734
|
"Cannot use <" + (el.tag) + "> as component root element because it may " +
|
7708
7735
|
'contain multiple nodes.'
|
7709
7736
|
);
|
7710
7737
|
}
|
7711
7738
|
if (el.attrsMap.hasOwnProperty('v-for')) {
|
7712
|
-
|
7713
|
-
warn$2(
|
7739
|
+
warnOnce(
|
7714
7740
|
'Cannot use v-for on stateful component root element because ' +
|
7715
7741
|
'it renders multiple elements.'
|
7716
7742
|
);
|
@@ -7730,9 +7756,8 @@ function parse (
|
|
7730
7756
|
exp: element.elseif,
|
7731
7757
|
block: element
|
7732
7758
|
});
|
7733
|
-
} else
|
7734
|
-
|
7735
|
-
warn$2(
|
7759
|
+
} else {
|
7760
|
+
warnOnce(
|
7736
7761
|
"Component template should contain exactly one root element. " +
|
7737
7762
|
"If you are using v-if on multiple elements, " +
|
7738
7763
|
"use v-else-if to chain them instead."
|
@@ -7777,11 +7802,16 @@ function parse (
|
|
7777
7802
|
|
7778
7803
|
chars: function chars (text) {
|
7779
7804
|
if (!currentParent) {
|
7780
|
-
|
7781
|
-
|
7782
|
-
|
7783
|
-
|
7784
|
-
|
7805
|
+
{
|
7806
|
+
if (text === template) {
|
7807
|
+
warnOnce(
|
7808
|
+
'Component template requires a root element, rather than just text.'
|
7809
|
+
);
|
7810
|
+
} else if ((text = text.trim())) {
|
7811
|
+
warnOnce(
|
7812
|
+
("text \"" + text + "\" outside root element will be ignored.")
|
7813
|
+
);
|
7814
|
+
}
|
7785
7815
|
}
|
7786
7816
|
return
|
7787
7817
|
}
|
@@ -7980,7 +8010,7 @@ function processComponent (el) {
|
|
7980
8010
|
|
7981
8011
|
function processAttrs (el) {
|
7982
8012
|
var list = el.attrsList;
|
7983
|
-
var i, l, name, rawName, value,
|
8013
|
+
var i, l, name, rawName, value, modifiers, isProp;
|
7984
8014
|
for (i = 0, l = list.length; i < l; i++) {
|
7985
8015
|
name = rawName = list[i].name;
|
7986
8016
|
value = list[i].value;
|
@@ -8018,7 +8048,8 @@ function processAttrs (el) {
|
|
8018
8048
|
name = name.replace(dirRE, '');
|
8019
8049
|
// parse arg
|
8020
8050
|
var argMatch = name.match(argRE);
|
8021
|
-
|
8051
|
+
var arg = argMatch && argMatch[1];
|
8052
|
+
if (arg) {
|
8022
8053
|
name = name.slice(0, -(arg.length + 1));
|
8023
8054
|
}
|
8024
8055
|
addDirective(el, name, rawName, value, arg, modifiers);
|
@@ -8270,9 +8301,9 @@ var modifierCode = {
|
|
8270
8301
|
shift: genGuard("!$event.shiftKey"),
|
8271
8302
|
alt: genGuard("!$event.altKey"),
|
8272
8303
|
meta: genGuard("!$event.metaKey"),
|
8273
|
-
left: genGuard("$event.button !== 0"),
|
8274
|
-
middle: genGuard("$event.button !== 1"),
|
8275
|
-
right: genGuard("$event.button !== 2")
|
8304
|
+
left: genGuard("'button' in $event && $event.button !== 0"),
|
8305
|
+
middle: genGuard("'button' in $event && $event.button !== 1"),
|
8306
|
+
right: genGuard("'button' in $event && $event.button !== 2")
|
8276
8307
|
};
|
8277
8308
|
|
8278
8309
|
function genHandlers (events, native) {
|
@@ -8289,34 +8320,52 @@ function genHandler (
|
|
8289
8320
|
) {
|
8290
8321
|
if (!handler) {
|
8291
8322
|
return 'function(){}'
|
8292
|
-
}
|
8323
|
+
}
|
8324
|
+
|
8325
|
+
if (Array.isArray(handler)) {
|
8293
8326
|
return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
|
8294
|
-
}
|
8295
|
-
|
8327
|
+
}
|
8328
|
+
|
8329
|
+
var isMethodPath = simplePathRE.test(handler.value);
|
8330
|
+
var isFunctionExpression = fnExpRE.test(handler.value);
|
8331
|
+
|
8332
|
+
if (!handler.modifiers) {
|
8333
|
+
return isMethodPath || isFunctionExpression
|
8296
8334
|
? handler.value
|
8297
|
-
: ("function($event){" + (handler.value) + "}")
|
8335
|
+
: ("function($event){" + (handler.value) + "}") // inline statement
|
8298
8336
|
} else {
|
8299
8337
|
var code = '';
|
8338
|
+
var genModifierCode = '';
|
8300
8339
|
var keys = [];
|
8301
8340
|
for (var key in handler.modifiers) {
|
8302
8341
|
if (modifierCode[key]) {
|
8303
|
-
|
8342
|
+
genModifierCode += modifierCode[key];
|
8343
|
+
// left/right
|
8344
|
+
if (keyCodes[key]) {
|
8345
|
+
keys.push(key);
|
8346
|
+
}
|
8304
8347
|
} else {
|
8305
8348
|
keys.push(key);
|
8306
8349
|
}
|
8307
8350
|
}
|
8308
8351
|
if (keys.length) {
|
8309
|
-
code
|
8352
|
+
code += genKeyFilter(keys);
|
8353
|
+
}
|
8354
|
+
// Make sure modifiers like prevent and stop get executed after key filtering
|
8355
|
+
if (genModifierCode) {
|
8356
|
+
code += genModifierCode;
|
8310
8357
|
}
|
8311
|
-
var handlerCode =
|
8358
|
+
var handlerCode = isMethodPath
|
8312
8359
|
? handler.value + '($event)'
|
8313
|
-
:
|
8360
|
+
: isFunctionExpression
|
8361
|
+
? ("(" + (handler.value) + ")($event)")
|
8362
|
+
: handler.value;
|
8314
8363
|
return ("function($event){" + code + handlerCode + "}")
|
8315
8364
|
}
|
8316
8365
|
}
|
8317
8366
|
|
8318
8367
|
function genKeyFilter (keys) {
|
8319
|
-
return ("if(" + (keys.map(genFilterCode).join('&&')) + ")return null;")
|
8368
|
+
return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
|
8320
8369
|
}
|
8321
8370
|
|
8322
8371
|
function genFilterCode (key) {
|
@@ -8549,7 +8598,7 @@ function genData (el) {
|
|
8549
8598
|
}
|
8550
8599
|
// component v-model
|
8551
8600
|
if (el.model) {
|
8552
|
-
data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + "},";
|
8601
|
+
data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
|
8553
8602
|
}
|
8554
8603
|
// inline-template
|
8555
8604
|
if (el.inlineTemplate) {
|
@@ -8626,10 +8675,8 @@ function genChildren (el, checkSkip) {
|
|
8626
8675
|
el$1.tag !== 'slot') {
|
8627
8676
|
return genElement(el$1)
|
8628
8677
|
}
|
8629
|
-
var normalizationType = getNormalizationType(children);
|
8630
|
-
return ("[" + (children.map(genNode).join(',')) + "]" + (
|
8631
|
-
? normalizationType ? ("," + normalizationType) : ''
|
8632
|
-
: ''))
|
8678
|
+
var normalizationType = checkSkip ? getNormalizationType(children) : 0;
|
8679
|
+
return ("[" + (children.map(genNode).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : ''))
|
8633
8680
|
}
|
8634
8681
|
}
|
8635
8682
|
|
@@ -8721,14 +8768,22 @@ function transformSpecialNewlines (text) {
|
|
8721
8768
|
|
8722
8769
|
/* */
|
8723
8770
|
|
8724
|
-
//
|
8771
|
+
// these keywords should not appear inside expressions, but operators like
|
8772
|
+
// typeof, instanceof and in are allowed
|
8725
8773
|
var prohibitedKeywordRE = new RegExp('\\b' + (
|
8726
8774
|
'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
|
8727
8775
|
'super,throw,while,yield,delete,export,import,return,switch,default,' +
|
8728
8776
|
'extends,finally,continue,debugger,function,arguments'
|
8729
8777
|
).split(',').join('\\b|\\b') + '\\b');
|
8778
|
+
|
8779
|
+
// these unary operators should not be used as property/method names
|
8780
|
+
var unaryOperatorsRE = new RegExp('\\b' + (
|
8781
|
+
'delete,typeof,void'
|
8782
|
+
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
|
8783
|
+
|
8730
8784
|
// check valid identifier for v-for
|
8731
8785
|
var identRE = /[A-Za-z_$][\w$]*/;
|
8786
|
+
|
8732
8787
|
// strip strings in expressions
|
8733
8788
|
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
|
8734
8789
|
|
@@ -8749,6 +8804,8 @@ function checkNode (node, errors) {
|
|
8749
8804
|
if (value) {
|
8750
8805
|
if (name === 'v-for') {
|
8751
8806
|
checkFor(node, ("v-for=\"" + value + "\""), errors);
|
8807
|
+
} else if (onRE.test(name)) {
|
8808
|
+
checkEvent(value, (name + "=\"" + value + "\""), errors);
|
8752
8809
|
} else {
|
8753
8810
|
checkExpression(value, (name + "=\"" + value + "\""), errors);
|
8754
8811
|
}
|
@@ -8765,6 +8822,17 @@ function checkNode (node, errors) {
|
|
8765
8822
|
}
|
8766
8823
|
}
|
8767
8824
|
|
8825
|
+
function checkEvent (exp, text, errors) {
|
8826
|
+
var keywordMatch = exp.replace(stripStringRE, '').match(unaryOperatorsRE);
|
8827
|
+
if (keywordMatch) {
|
8828
|
+
errors.push(
|
8829
|
+
"avoid using JavaScript unary operator as property name: " +
|
8830
|
+
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
|
8831
|
+
);
|
8832
|
+
}
|
8833
|
+
checkExpression(exp, text, errors);
|
8834
|
+
}
|
8835
|
+
|
8768
8836
|
function checkFor (node, text, errors) {
|
8769
8837
|
checkExpression(node.for || '', text, errors);
|
8770
8838
|
checkIdentifier(node.alias, 'v-for alias', text, errors);
|
@@ -9131,8 +9199,8 @@ Vue$3.prototype.$mount = function (
|
|
9131
9199
|
}
|
9132
9200
|
if (template) {
|
9133
9201
|
/* istanbul ignore if */
|
9134
|
-
if ("development" !== 'production' && config.performance &&
|
9135
|
-
|
9202
|
+
if ("development" !== 'production' && config.performance && mark) {
|
9203
|
+
mark('compile');
|
9136
9204
|
}
|
9137
9205
|
|
9138
9206
|
var ref = compileToFunctions(template, {
|
@@ -9145,9 +9213,9 @@ Vue$3.prototype.$mount = function (
|
|
9145
9213
|
options.staticRenderFns = staticRenderFns;
|
9146
9214
|
|
9147
9215
|
/* istanbul ignore if */
|
9148
|
-
if ("development" !== 'production' && config.performance &&
|
9149
|
-
|
9150
|
-
|
9216
|
+
if ("development" !== 'production' && config.performance && mark) {
|
9217
|
+
mark('compile end');
|
9218
|
+
measure(((this._name) + " compile"), 'compile', 'compile end');
|
9151
9219
|
}
|
9152
9220
|
}
|
9153
9221
|
}
|
@@ -9172,4 +9240,4 @@ Vue$3.compile = compileToFunctions;
|
|
9172
9240
|
|
9173
9241
|
return Vue$3;
|
9174
9242
|
|
9175
|
-
})));
|
9243
|
+
})));
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vue-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marshall Shen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple asset-pipeline wrapper for vue.js by Evan You
|
14
14
|
email:
|