vuejs-rails 2.0.3 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dccbfdeaf50838a4cdddb42b596fffc4095a8a02
4
- data.tar.gz: f3c20cd171f52a741cbba7f9073bd311a32fd6e3
3
+ metadata.gz: d64e5ab7056e1c860447c1874d5a97648ecb2eec
4
+ data.tar.gz: f5d84b069fb1a787af4eff100a60b50b17a0fe90
5
5
  SHA512:
6
- metadata.gz: a9b03ac7816c6eda4ff85470c851eb3a00b70c257e6bdba20afd356898f783845dd1fa9d94753b301a9ec0e5b7296e567e1d21a6276015e03543d948926ce686
7
- data.tar.gz: e62f8e615a2ad5f943d12afd036a9aa2d1f90eb9c64da9db9d369ebcdf1728359cb851db056c451a4b74ef52672d6cc555e9101cfdc2451e3134b385119200f8
6
+ metadata.gz: ce1f4729d0b911ab1bac8e097f2f7d59587acb2fa08c8045accef1bb2ea9d31dd789e504380ec7bdbf9e65893de98cc09a9833deca9cdf07af83de2758c7ed72
7
+ data.tar.gz: 6b3f279a1f8d1e70be1188cacfe4efb3a7923773e804617659e8d3abe5c608b4379ffcae6e71ad28262b7f53ee2a84fd5f55b592211a499cda7423b7dedd6e77
@@ -1,5 +1,5 @@
1
1
  module Vue
2
2
  module Rails
3
- VERSION = '2.0.3'
3
+ VERSION = '2.0.5'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vue.js v2.0.3
2
+ * Vue.js v2.0.5
3
3
  * (c) 2014-2016 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -347,7 +347,7 @@ function def (obj, key, val, enumerable) {
347
347
  /**
348
348
  * Parse simple path.
349
349
  */
350
- var bailRE = /[^\w\.\$]/;
350
+ var bailRE = /[^\w.$]/;
351
351
  function parsePath (path) {
352
352
  if (bailRE.test(path)) {
353
353
  return
@@ -862,7 +862,7 @@ Watcher.prototype.depend = function depend () {
862
862
  };
863
863
 
864
864
  /**
865
- * Remove self from all dependencies' subcriber list.
865
+ * Remove self from all dependencies' subscriber list.
866
866
  */
867
867
  Watcher.prototype.teardown = function teardown () {
868
868
  var this$1 = this;
@@ -889,31 +889,31 @@ Watcher.prototype.teardown = function teardown () {
889
889
  * is collected as a "deep" dependency.
890
890
  */
891
891
  var seenObjects = new _Set();
892
- function traverse (val, seen) {
892
+ function traverse (val) {
893
+ seenObjects.clear();
894
+ _traverse(val, seenObjects);
895
+ }
896
+
897
+ function _traverse (val, seen) {
893
898
  var i, keys;
894
- if (!seen) {
895
- seen = seenObjects;
896
- seen.clear();
897
- }
898
899
  var isA = Array.isArray(val);
899
- var isO = isObject(val);
900
- if ((isA || isO) && Object.isExtensible(val)) {
901
- if (val.__ob__) {
902
- var depId = val.__ob__.dep.id;
903
- if (seen.has(depId)) {
904
- return
905
- } else {
906
- seen.add(depId);
907
- }
908
- }
909
- if (isA) {
910
- i = val.length;
911
- while (i--) { traverse(val[i], seen); }
912
- } else if (isO) {
913
- keys = Object.keys(val);
914
- i = keys.length;
915
- while (i--) { traverse(val[keys[i]], seen); }
900
+ if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
901
+ return
902
+ }
903
+ if (val.__ob__) {
904
+ var depId = val.__ob__.dep.id;
905
+ if (seen.has(depId)) {
906
+ return
916
907
  }
908
+ seen.add(depId);
909
+ }
910
+ if (isA) {
911
+ i = val.length;
912
+ while (i--) { _traverse(val[i], seen); }
913
+ } else {
914
+ keys = Object.keys(val);
915
+ i = keys.length;
916
+ while (i--) { _traverse(val[keys[i]], seen); }
917
917
  }
918
918
  }
919
919
 
@@ -1136,6 +1136,7 @@ function defineReactive$$1 (
1136
1136
  */
1137
1137
  function set (obj, key, val) {
1138
1138
  if (Array.isArray(obj)) {
1139
+ obj.length = Math.max(obj.length, key);
1139
1140
  obj.splice(key, 1, val);
1140
1141
  return val
1141
1142
  }
@@ -1320,12 +1321,16 @@ function initMethods (vm) {
1320
1321
  if (methods) {
1321
1322
  for (var key in methods) {
1322
1323
  vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
1323
- if ("development" !== 'production' && methods[key] == null) {
1324
- warn(
1324
+ {
1325
+ methods[key] == null && warn(
1325
1326
  "method \"" + key + "\" has an undefined value in the component definition. " +
1326
1327
  "Did you reference the function correctly?",
1327
1328
  vm
1328
1329
  );
1330
+ hasOwn(Vue$2.prototype, key) && warn(
1331
+ ("Avoid overriding Vue's internal method \"" + key + "\"."),
1332
+ vm
1333
+ );
1329
1334
  }
1330
1335
  }
1331
1336
  }
@@ -1443,6 +1448,7 @@ var VNode = function VNode (
1443
1448
  this.isRootInsert = true;
1444
1449
  this.isComment = false;
1445
1450
  this.isCloned = false;
1451
+ this.isOnce = false;
1446
1452
  };
1447
1453
 
1448
1454
  var emptyVNode = function () {
@@ -1763,6 +1769,7 @@ function lifecycleMixin (Vue) {
1763
1769
  {
1764
1770
  observerState.isSettingProps = false;
1765
1771
  }
1772
+ vm.$options.propsData = propsData;
1766
1773
  }
1767
1774
  // update listeners
1768
1775
  if (listeners) {
@@ -1850,7 +1857,7 @@ function createComponent (
1850
1857
  }
1851
1858
 
1852
1859
  if (isObject(Ctor)) {
1853
- Ctor = Vue$3.extend(Ctor);
1860
+ Ctor = Vue$2.extend(Ctor);
1854
1861
  }
1855
1862
 
1856
1863
  if (typeof Ctor !== 'function') {
@@ -1860,6 +1867,10 @@ function createComponent (
1860
1867
  return
1861
1868
  }
1862
1869
 
1870
+ // resolve constructor options in case global mixins are applied after
1871
+ // component constructor creation
1872
+ resolveConstructorOptions(Ctor);
1873
+
1863
1874
  // async component
1864
1875
  if (!Ctor.cid) {
1865
1876
  if (Ctor.resolved) {
@@ -2029,7 +2040,7 @@ function resolveAsyncComponent (
2029
2040
 
2030
2041
  var resolve = function (res) {
2031
2042
  if (isObject(res)) {
2032
- res = Vue$3.extend(res);
2043
+ res = Vue$2.extend(res);
2033
2044
  }
2034
2045
  // cache resolved
2035
2046
  factory.resolved = res;
@@ -2063,7 +2074,7 @@ function resolveAsyncComponent (
2063
2074
  }
2064
2075
 
2065
2076
  function extractProps (data, Ctor) {
2066
- // we are only extrating raw values here.
2077
+ // we are only extracting raw values here.
2067
2078
  // validation and default values are handled in the child
2068
2079
  // component itself.
2069
2080
  var propOptions = Ctor.options.props;
@@ -2182,8 +2193,9 @@ function _createElement (
2182
2193
  // unknown or unlisted namespaced elements
2183
2194
  // check at runtime because it may get assigned a namespace when its
2184
2195
  // parent normalizes children
2196
+ var childNs = tag === 'foreignObject' ? 'xhtml' : ns;
2185
2197
  return new VNode(
2186
- tag, data, normalizeChildren(children, ns),
2198
+ tag, data, normalizeChildren(children, childNs),
2187
2199
  undefined, undefined, ns, context
2188
2200
  )
2189
2201
  }
@@ -2249,7 +2261,7 @@ function renderMixin (Vue) {
2249
2261
  if (config._isServer) {
2250
2262
  throw e
2251
2263
  } else {
2252
- setTimeout(function () { throw e }, 0);
2264
+ console.error(e);
2253
2265
  }
2254
2266
  }
2255
2267
  // return previous vnode to prevent render error causing blank component
@@ -2299,19 +2311,37 @@ function renderMixin (Vue) {
2299
2311
  }
2300
2312
  // otherwise, render a fresh tree.
2301
2313
  tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
2314
+ markStatic(tree, ("__static__" + index), false);
2315
+ return tree
2316
+ };
2317
+
2318
+ // mark node as static (v-once)
2319
+ Vue.prototype._o = function markOnce (
2320
+ tree,
2321
+ index,
2322
+ key
2323
+ ) {
2324
+ markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
2325
+ return tree
2326
+ };
2327
+
2328
+ function markStatic (tree, key, isOnce) {
2302
2329
  if (Array.isArray(tree)) {
2303
2330
  for (var i = 0; i < tree.length; i++) {
2304
- if (typeof tree[i] !== 'string') {
2305
- tree[i].isStatic = true;
2306
- tree[i].key = "__static__" + index + "_" + i;
2331
+ if (tree[i] && typeof tree[i] !== 'string') {
2332
+ markStaticNode(tree[i], (key + "_" + i), isOnce);
2307
2333
  }
2308
2334
  }
2309
2335
  } else {
2310
- tree.isStatic = true;
2311
- tree.key = "__static__" + index;
2336
+ markStaticNode(tree, key, isOnce);
2312
2337
  }
2313
- return tree
2314
- };
2338
+ }
2339
+
2340
+ function markStaticNode (node, key, isOnce) {
2341
+ node.isStatic = true;
2342
+ node.key = key;
2343
+ node.isOnce = isOnce;
2344
+ }
2315
2345
 
2316
2346
  // filter resolution helper
2317
2347
  var identity = function (_) { return _; };
@@ -2533,7 +2563,7 @@ function initMixin (Vue) {
2533
2563
  initInternalComponent(vm, options);
2534
2564
  } else {
2535
2565
  vm.$options = mergeOptions(
2536
- resolveConstructorOptions(vm),
2566
+ resolveConstructorOptions(vm.constructor),
2537
2567
  options || {},
2538
2568
  vm
2539
2569
  );
@@ -2551,54 +2581,56 @@ function initMixin (Vue) {
2551
2581
  callHook(vm, 'created');
2552
2582
  initRender(vm);
2553
2583
  };
2584
+ }
2554
2585
 
2555
- function initInternalComponent (vm, options) {
2556
- var opts = vm.$options = Object.create(resolveConstructorOptions(vm));
2557
- // doing this because it's faster than dynamic enumeration.
2558
- opts.parent = options.parent;
2559
- opts.propsData = options.propsData;
2560
- opts._parentVnode = options._parentVnode;
2561
- opts._parentListeners = options._parentListeners;
2562
- opts._renderChildren = options._renderChildren;
2563
- opts._componentTag = options._componentTag;
2564
- if (options.render) {
2565
- opts.render = options.render;
2566
- opts.staticRenderFns = options.staticRenderFns;
2567
- }
2568
- }
2569
-
2570
- function resolveConstructorOptions (vm) {
2571
- var Ctor = vm.constructor;
2572
- var options = Ctor.options;
2573
- if (Ctor.super) {
2574
- var superOptions = Ctor.super.options;
2575
- var cachedSuperOptions = Ctor.superOptions;
2576
- if (superOptions !== cachedSuperOptions) {
2577
- // super option changed
2578
- Ctor.superOptions = superOptions;
2579
- options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
2580
- if (options.name) {
2581
- options.components[options.name] = Ctor;
2582
- }
2586
+ function initInternalComponent (vm, options) {
2587
+ var opts = vm.$options = Object.create(vm.constructor.options);
2588
+ // doing this because it's faster than dynamic enumeration.
2589
+ opts.parent = options.parent;
2590
+ opts.propsData = options.propsData;
2591
+ opts._parentVnode = options._parentVnode;
2592
+ opts._parentListeners = options._parentListeners;
2593
+ opts._renderChildren = options._renderChildren;
2594
+ opts._componentTag = options._componentTag;
2595
+ if (options.render) {
2596
+ opts.render = options.render;
2597
+ opts.staticRenderFns = options.staticRenderFns;
2598
+ }
2599
+ }
2600
+
2601
+ function resolveConstructorOptions (Ctor) {
2602
+ var options = Ctor.options;
2603
+ if (Ctor.super) {
2604
+ var superOptions = Ctor.super.options;
2605
+ var cachedSuperOptions = Ctor.superOptions;
2606
+ var extendOptions = Ctor.extendOptions;
2607
+ if (superOptions !== cachedSuperOptions) {
2608
+ // super option changed
2609
+ Ctor.superOptions = superOptions;
2610
+ extendOptions.render = options.render;
2611
+ extendOptions.staticRenderFns = options.staticRenderFns;
2612
+ options = Ctor.options = mergeOptions(superOptions, extendOptions);
2613
+ if (options.name) {
2614
+ options.components[options.name] = Ctor;
2583
2615
  }
2584
2616
  }
2585
- return options
2586
2617
  }
2618
+ return options
2587
2619
  }
2588
2620
 
2589
- function Vue$3 (options) {
2621
+ function Vue$2 (options) {
2590
2622
  if ("development" !== 'production' &&
2591
- !(this instanceof Vue$3)) {
2623
+ !(this instanceof Vue$2)) {
2592
2624
  warn('Vue is a constructor and should be called with the `new` keyword');
2593
2625
  }
2594
2626
  this._init(options);
2595
2627
  }
2596
2628
 
2597
- initMixin(Vue$3);
2598
- stateMixin(Vue$3);
2599
- eventsMixin(Vue$3);
2600
- lifecycleMixin(Vue$3);
2601
- renderMixin(Vue$3);
2629
+ initMixin(Vue$2);
2630
+ stateMixin(Vue$2);
2631
+ eventsMixin(Vue$2);
2632
+ lifecycleMixin(Vue$2);
2633
+ renderMixin(Vue$2);
2602
2634
 
2603
2635
  var warn = noop;
2604
2636
  var formatComponentName;
@@ -2817,26 +2849,16 @@ var defaultStrat = function (parentVal, childVal) {
2817
2849
  };
2818
2850
 
2819
2851
  /**
2820
- * Make sure component options get converted to actual
2821
- * constructors.
2852
+ * Validate component names
2822
2853
  */
2823
- function normalizeComponents (options) {
2824
- if (options.components) {
2825
- var components = options.components;
2826
- var def;
2827
- for (var key in components) {
2828
- var lower = key.toLowerCase();
2829
- if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
2830
- "development" !== 'production' && warn(
2831
- 'Do not use built-in or reserved HTML elements as component ' +
2832
- 'id: ' + key
2833
- );
2834
- continue
2835
- }
2836
- def = components[key];
2837
- if (isPlainObject(def)) {
2838
- components[key] = Vue$3.extend(def);
2839
- }
2854
+ function checkComponents (options) {
2855
+ for (var key in options.components) {
2856
+ var lower = key.toLowerCase();
2857
+ if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
2858
+ warn(
2859
+ 'Do not use built-in or reserved HTML elements as component ' +
2860
+ 'id: ' + key
2861
+ );
2840
2862
  }
2841
2863
  }
2842
2864
  }
@@ -2897,7 +2919,9 @@ function mergeOptions (
2897
2919
  child,
2898
2920
  vm
2899
2921
  ) {
2900
- normalizeComponents(child);
2922
+ {
2923
+ checkComponents(child);
2924
+ }
2901
2925
  normalizeProps(child);
2902
2926
  normalizeDirectives(child);
2903
2927
  var extendsFrom = child.extends;
@@ -2909,7 +2933,7 @@ function mergeOptions (
2909
2933
  if (child.mixins) {
2910
2934
  for (var i = 0, l = child.mixins.length; i < l; i++) {
2911
2935
  var mixin = child.mixins[i];
2912
- if (mixin.prototype instanceof Vue$3) {
2936
+ if (mixin.prototype instanceof Vue$2) {
2913
2937
  mixin = mixin.options;
2914
2938
  }
2915
2939
  parent = mergeOptions(parent, mixin, vm);
@@ -3000,7 +3024,7 @@ function validateProp (
3000
3024
  /**
3001
3025
  * Get the default value of a prop.
3002
3026
  */
3003
- function getPropDefaultValue (vm, prop, name) {
3027
+ function getPropDefaultValue (vm, prop, key) {
3004
3028
  // no default, return undefined
3005
3029
  if (!hasOwn(prop, 'default')) {
3006
3030
  return undefined
@@ -3009,12 +3033,19 @@ function getPropDefaultValue (vm, prop, name) {
3009
3033
  // warn against non-factory defaults for Object & Array
3010
3034
  if (isObject(def)) {
3011
3035
  "development" !== 'production' && warn(
3012
- 'Invalid default value for prop "' + name + '": ' +
3036
+ 'Invalid default value for prop "' + key + '": ' +
3013
3037
  'Props with type Object/Array must use a factory function ' +
3014
3038
  'to return the default value.',
3015
3039
  vm
3016
3040
  );
3017
3041
  }
3042
+ // the raw prop value was also undefined from previous render,
3043
+ // return previous default value to avoid unnecessary watcher trigger
3044
+ if (vm && vm.$options.propsData &&
3045
+ vm.$options.propsData[key] === undefined &&
3046
+ vm[key] !== undefined) {
3047
+ return vm[key]
3048
+ }
3018
3049
  // call factory function for non-Function types
3019
3050
  return typeof def === 'function' && prop.type !== Function
3020
3051
  ? def.call(vm)
@@ -3228,7 +3259,6 @@ function initExtend (Vue) {
3228
3259
  'Invalid component name: "' + name + '". Component names ' +
3229
3260
  'can only contain alphanumeric characaters and the hyphen.'
3230
3261
  );
3231
- name = null;
3232
3262
  }
3233
3263
  }
3234
3264
  var Sub = function VueComponent (options) {
@@ -3374,13 +3404,13 @@ function initGlobalAPI (Vue) {
3374
3404
  initAssetRegisters(Vue);
3375
3405
  }
3376
3406
 
3377
- initGlobalAPI(Vue$3);
3407
+ initGlobalAPI(Vue$2);
3378
3408
 
3379
- Object.defineProperty(Vue$3.prototype, '$isServer', {
3409
+ Object.defineProperty(Vue$2.prototype, '$isServer', {
3380
3410
  get: function () { return config._isServer; }
3381
3411
  });
3382
3412
 
3383
- Vue$3.version = '2.0.3';
3413
+ Vue$2.version = '2.0.5';
3384
3414
 
3385
3415
  /* */
3386
3416
 
@@ -3506,7 +3536,8 @@ function stringifyClass (value) {
3506
3536
 
3507
3537
  var namespaceMap = {
3508
3538
  svg: 'http://www.w3.org/2000/svg',
3509
- math: 'http://www.w3.org/1998/Math/MathML'
3539
+ math: 'http://www.w3.org/1998/Math/MathML',
3540
+ xhtml: 'http://www.w3.org/1999/xhtm'
3510
3541
  };
3511
3542
 
3512
3543
  var isHTMLTag = makeMap(
@@ -3814,7 +3845,10 @@ function createPatchFunction (backend) {
3814
3845
 
3815
3846
  function removeElement (el) {
3816
3847
  var parent = nodeOps.parentNode(el);
3817
- nodeOps.removeChild(parent, el);
3848
+ // element may have already been removed due to v-html
3849
+ if (parent) {
3850
+ nodeOps.removeChild(parent, el);
3851
+ }
3818
3852
  }
3819
3853
 
3820
3854
  function createElm (vnode, insertedVnodeQueue, nested) {
@@ -4073,7 +4107,7 @@ function createPatchFunction (backend) {
4073
4107
  if (vnode.isStatic &&
4074
4108
  oldVnode.isStatic &&
4075
4109
  vnode.key === oldVnode.key &&
4076
- vnode.isCloned) {
4110
+ (vnode.isCloned || vnode.isOnce)) {
4077
4111
  vnode.elm = oldVnode.elm;
4078
4112
  return
4079
4113
  }
@@ -4511,7 +4545,7 @@ function updateDOMProps (oldVnode, vnode) {
4511
4545
 
4512
4546
  for (key in oldProps) {
4513
4547
  if (props[key] == null) {
4514
- elm[key] = undefined;
4548
+ elm[key] = '';
4515
4549
  }
4516
4550
  }
4517
4551
  for (key in props) {
@@ -4544,6 +4578,16 @@ var domProps = {
4544
4578
 
4545
4579
  /* */
4546
4580
 
4581
+ var cssVarRE = /^--/;
4582
+ var setProp = function (el, name, val) {
4583
+ /* istanbul ignore if */
4584
+ if (cssVarRE.test(name)) {
4585
+ el.style.setProperty(name, val);
4586
+ } else {
4587
+ el.style[normalize(name)] = val;
4588
+ }
4589
+ };
4590
+
4547
4591
  var prefixes = ['Webkit', 'Moz', 'ms'];
4548
4592
 
4549
4593
  var testEl;
@@ -4592,14 +4636,14 @@ function updateStyle (oldVnode, vnode) {
4592
4636
 
4593
4637
  for (name in oldStyle) {
4594
4638
  if (style[name] == null) {
4595
- el.style[normalize(name)] = '';
4639
+ setProp(el, name, '');
4596
4640
  }
4597
4641
  }
4598
4642
  for (name in style) {
4599
4643
  cur = style[name];
4600
4644
  if (cur !== oldStyle[name]) {
4601
4645
  // ie9 setting to null has no effect, must use empty string
4602
- el.style[normalize(name)] = cur == null ? '' : cur;
4646
+ setProp(el, name, cur == null ? '' : cur);
4603
4647
  }
4604
4648
  }
4605
4649
  }
@@ -4616,6 +4660,11 @@ var style = {
4616
4660
  * SVG elements in IE
4617
4661
  */
4618
4662
  function addClass (el, cls) {
4663
+ /* istanbul ignore if */
4664
+ if (!cls || !cls.trim()) {
4665
+ return
4666
+ }
4667
+
4619
4668
  /* istanbul ignore else */
4620
4669
  if (el.classList) {
4621
4670
  if (cls.indexOf(' ') > -1) {
@@ -4636,6 +4685,11 @@ function addClass (el, cls) {
4636
4685
  * SVG elements in IE
4637
4686
  */
4638
4687
  function removeClass (el, cls) {
4688
+ /* istanbul ignore if */
4689
+ if (!cls || !cls.trim()) {
4690
+ return
4691
+ }
4692
+
4639
4693
  /* istanbul ignore else */
4640
4694
  if (el.classList) {
4641
4695
  if (cls.indexOf(' ') > -1) {
@@ -4780,6 +4834,11 @@ function getTransitionInfo (el, expectedType) {
4780
4834
  }
4781
4835
 
4782
4836
  function getTimeout (delays, durations) {
4837
+ /* istanbul ignore next */
4838
+ while (delays.length < durations.length) {
4839
+ delays = delays.concat(delays);
4840
+ }
4841
+
4783
4842
  return Math.max.apply(null, durations.map(function (d, i) {
4784
4843
  return toMs(d) + toMs(delays[i])
4785
4844
  }))
@@ -5067,7 +5126,7 @@ var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
5067
5126
  * properties to Elements.
5068
5127
  */
5069
5128
 
5070
- var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_\-]*)?$/;
5129
+ var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
5071
5130
 
5072
5131
  /* istanbul ignore if */
5073
5132
  if (isIE9) {
@@ -5120,7 +5179,7 @@ var model = {
5120
5179
  setSelected(el, binding, vnode.context);
5121
5180
  // in case the options rendered by v-for have changed,
5122
5181
  // it's possible that the value is out-of-sync with the rendered options.
5123
- // detect such cases and filter out values that no longer has a matchig
5182
+ // detect such cases and filter out values that no longer has a matching
5124
5183
  // option in the DOM.
5125
5184
  var needReset = el.multiple
5126
5185
  ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
@@ -5265,7 +5324,7 @@ var transitionProps = {
5265
5324
  };
5266
5325
 
5267
5326
  // in case the child is also an abstract component, e.g. <keep-alive>
5268
- // we want to recrusively retrieve the real component to be rendered
5327
+ // we want to recursively retrieve the real component to be rendered
5269
5328
  function getRealChild (vnode) {
5270
5329
  var compOptions = vnode && vnode.componentOptions;
5271
5330
  if (compOptions && compOptions.Ctor.options.abstract) {
@@ -5571,20 +5630,20 @@ var platformComponents = {
5571
5630
  /* */
5572
5631
 
5573
5632
  // install platform specific utils
5574
- Vue$3.config.isUnknownElement = isUnknownElement;
5575
- Vue$3.config.isReservedTag = isReservedTag;
5576
- Vue$3.config.getTagNamespace = getTagNamespace;
5577
- Vue$3.config.mustUseProp = mustUseProp;
5633
+ Vue$2.config.isUnknownElement = isUnknownElement;
5634
+ Vue$2.config.isReservedTag = isReservedTag;
5635
+ Vue$2.config.getTagNamespace = getTagNamespace;
5636
+ Vue$2.config.mustUseProp = mustUseProp;
5578
5637
 
5579
5638
  // install platform runtime directives & components
5580
- extend(Vue$3.options.directives, platformDirectives);
5581
- extend(Vue$3.options.components, platformComponents);
5639
+ extend(Vue$2.options.directives, platformDirectives);
5640
+ extend(Vue$2.options.components, platformComponents);
5582
5641
 
5583
5642
  // install platform patch function
5584
- Vue$3.prototype.__patch__ = config._isServer ? noop : patch$1;
5643
+ Vue$2.prototype.__patch__ = config._isServer ? noop : patch$1;
5585
5644
 
5586
5645
  // wrap mount
5587
- Vue$3.prototype.$mount = function (
5646
+ Vue$2.prototype.$mount = function (
5588
5647
  el,
5589
5648
  hydrating
5590
5649
  ) {
@@ -5597,7 +5656,7 @@ Vue$3.prototype.$mount = function (
5597
5656
  setTimeout(function () {
5598
5657
  if (config.devtools) {
5599
5658
  if (devtools) {
5600
- devtools.emit('init', Vue$3);
5659
+ devtools.emit('init', Vue$2);
5601
5660
  } else if (
5602
5661
  "development" !== 'production' &&
5603
5662
  inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)
@@ -5644,7 +5703,7 @@ function decode (html) {
5644
5703
  */
5645
5704
 
5646
5705
  // Regular Expressions for parsing tags and attributes
5647
- var singleAttrIdentifier = /([^\s"'<>\/=]+)/;
5706
+ var singleAttrIdentifier = /([^\s"'<>/=]+)/;
5648
5707
  var singleAttrAssign = /(?:=)/;
5649
5708
  var singleAttrValues = [
5650
5709
  // attr value double quotes
@@ -5668,6 +5727,8 @@ var startTagOpen = new RegExp('^<' + qnameCapture);
5668
5727
  var startTagClose = /^\s*(\/?)>/;
5669
5728
  var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
5670
5729
  var doctype = /^<!DOCTYPE [^>]+>/i;
5730
+ var comment = /^<!--/;
5731
+ var conditionalComment = /^<!\[/;
5671
5732
 
5672
5733
  var IS_REGEX_CAPTURING_BROKEN = false;
5673
5734
  'x'.replace(/x(.)?/g, function (m, g) {
@@ -5675,7 +5736,23 @@ var IS_REGEX_CAPTURING_BROKEN = false;
5675
5736
  });
5676
5737
 
5677
5738
  // Special Elements (can contain anything)
5678
- var isSpecialTag = makeMap('script,style', true);
5739
+ var isScriptOrStyle = makeMap('script,style', true);
5740
+ var hasLang = function (attr) { return attr.name === 'lang' && attr.value !== 'html'; };
5741
+ var isSpecialTag = function (tag, isSFC, stack) {
5742
+ if (isScriptOrStyle(tag)) {
5743
+ return true
5744
+ }
5745
+ // top-level template that has a pre-processor
5746
+ if (
5747
+ isSFC &&
5748
+ tag === 'template' &&
5749
+ stack.length === 1 &&
5750
+ stack[0].attrs.some(hasLang)
5751
+ ) {
5752
+ return true
5753
+ }
5754
+ return false
5755
+ };
5679
5756
 
5680
5757
  var reCache = {};
5681
5758
 
@@ -5705,11 +5782,11 @@ function parseHTML (html, options) {
5705
5782
  while (html) {
5706
5783
  last = html;
5707
5784
  // Make sure we're not in a script or style element
5708
- if (!lastTag || !isSpecialTag(lastTag)) {
5785
+ if (!lastTag || !isSpecialTag(lastTag, options.sfc, stack)) {
5709
5786
  var textEnd = html.indexOf('<');
5710
5787
  if (textEnd === 0) {
5711
5788
  // Comment:
5712
- if (/^<!--/.test(html)) {
5789
+ if (comment.test(html)) {
5713
5790
  var commentEnd = html.indexOf('-->');
5714
5791
 
5715
5792
  if (commentEnd >= 0) {
@@ -5719,7 +5796,7 @@ function parseHTML (html, options) {
5719
5796
  }
5720
5797
 
5721
5798
  // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
5722
- if (/^<!\[/.test(html)) {
5799
+ if (conditionalComment.test(html)) {
5723
5800
  var conditionalEnd = html.indexOf(']>');
5724
5801
 
5725
5802
  if (conditionalEnd >= 0) {
@@ -5752,16 +5829,31 @@ function parseHTML (html, options) {
5752
5829
  }
5753
5830
  }
5754
5831
 
5755
- var text = void 0;
5756
- if (textEnd >= 0) {
5832
+ var text = void 0, rest$1 = void 0, next = void 0;
5833
+ if (textEnd > 0) {
5834
+ rest$1 = html.slice(textEnd);
5835
+ while (
5836
+ !endTag.test(rest$1) &&
5837
+ !startTagOpen.test(rest$1) &&
5838
+ !comment.test(rest$1) &&
5839
+ !conditionalComment.test(rest$1)
5840
+ ) {
5841
+ // < in plain text, be forgiving and treat it as text
5842
+ next = rest$1.indexOf('<', 1);
5843
+ if (next < 0) { break }
5844
+ textEnd += next;
5845
+ rest$1 = html.slice(textEnd);
5846
+ }
5757
5847
  text = html.substring(0, textEnd);
5758
5848
  advance(textEnd);
5759
- } else {
5849
+ }
5850
+
5851
+ if (textEnd < 0) {
5760
5852
  text = html;
5761
5853
  html = '';
5762
5854
  }
5763
5855
 
5764
- if (options.chars) {
5856
+ if (options.chars && text) {
5765
5857
  options.chars(text);
5766
5858
  }
5767
5859
  } else {
@@ -5773,7 +5865,7 @@ function parseHTML (html, options) {
5773
5865
  if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
5774
5866
  text = text
5775
5867
  .replace(/<!--([\s\S]*?)-->/g, '$1')
5776
- .replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, '$1');
5868
+ .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
5777
5869
  }
5778
5870
  if (options.chars) {
5779
5871
  options.chars(text);
@@ -5785,8 +5877,9 @@ function parseHTML (html, options) {
5785
5877
  parseEndTag('</' + stackedTag + '>', stackedTag, index - endTagLength, index);
5786
5878
  }
5787
5879
 
5788
- if (html === last) {
5789
- throw new Error('Error parsing template:\n\n' + html)
5880
+ if (html === last && options.chars) {
5881
+ options.chars(html);
5882
+ break
5790
5883
  }
5791
5884
  }
5792
5885
 
@@ -5993,7 +6086,7 @@ function wrapFilter (exp, filter) {
5993
6086
  /* */
5994
6087
 
5995
6088
  var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
5996
- var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
6089
+ var regexEscapeRE = /[-.*+?^${}()|[\]/\\]/g;
5997
6090
 
5998
6091
  var buildRegex = cached(function (delimiters) {
5999
6092
  var open = delimiters[0].replace(regexEscapeRE, '\\$&');
@@ -6134,7 +6227,7 @@ var forIteratorRE = /\(([^,]*),([^,]*)(?:,([^,]*))?\)/;
6134
6227
  var bindRE = /^:|^v-bind:/;
6135
6228
  var onRE = /^@|^v-on:/;
6136
6229
  var argRE = /:(.*)$/;
6137
- var modifierRE = /\.[^\.]+/g;
6230
+ var modifierRE = /\.[^.]+/g;
6138
6231
  var specialNewlineRE = /\u2028|\u2029/g;
6139
6232
 
6140
6233
  var decodeHTMLCached = cached(decode);
@@ -6243,14 +6336,16 @@ function parse (
6243
6336
  }
6244
6337
 
6245
6338
  function checkRootConstraints (el) {
6246
- {
6339
+ if ("development" !== 'production' && !warned) {
6247
6340
  if (el.tag === 'slot' || el.tag === 'template') {
6341
+ warned = true;
6248
6342
  warn$1(
6249
6343
  "Cannot use <" + (el.tag) + "> as component root element because it may " +
6250
6344
  'contain multiple nodes:\n' + template
6251
6345
  );
6252
6346
  }
6253
6347
  if (el.attrsMap.hasOwnProperty('v-for')) {
6348
+ warned = true;
6254
6349
  warn$1(
6255
6350
  'Cannot use v-for on stateful component root element because ' +
6256
6351
  'it renders multiple elements:\n' + template
@@ -6263,12 +6358,12 @@ function parse (
6263
6358
  if (!root) {
6264
6359
  root = element;
6265
6360
  checkRootConstraints(root);
6266
- } else if ("development" !== 'production' && !stack.length && !warned) {
6361
+ } else if (!stack.length) {
6267
6362
  // allow 2 root elements with v-if and v-else
6268
6363
  if (root.if && element.else) {
6269
6364
  checkRootConstraints(element);
6270
6365
  root.elseBlock = element;
6271
- } else {
6366
+ } else if ("development" !== 'production' && !warned) {
6272
6367
  warned = true;
6273
6368
  warn$1(
6274
6369
  ("Component template should contain exactly one root element:\n\n" + template)
@@ -6510,8 +6605,9 @@ function processAttrs (el) {
6510
6605
  if (expression) {
6511
6606
  warn$1(
6512
6607
  name + "=\"" + value + "\": " +
6513
- 'Interpolation inside attributes has been deprecated. ' +
6514
- 'Use v-bind or the colon shorthand instead.'
6608
+ 'Interpolation inside attributes has been removed. ' +
6609
+ 'Use v-bind or the colon shorthand instead. For example, ' +
6610
+ 'instead of <div id="{{ val }}">, use <div :id="val">.'
6515
6611
  );
6516
6612
  }
6517
6613
  }
@@ -6608,7 +6704,7 @@ var isPlatformReservedTag;
6608
6704
  var genStaticKeysCached = cached(genStaticKeys$1);
6609
6705
 
6610
6706
  /**
6611
- * Goal of the optimizier: walk the generated template AST tree
6707
+ * Goal of the optimizer: walk the generated template AST tree
6612
6708
  * and detect sub-trees that are purely static, i.e. parts of
6613
6709
  * the DOM that never needs to change.
6614
6710
  *
@@ -6650,9 +6746,11 @@ function markStatic (node) {
6650
6746
 
6651
6747
  function markStaticRoots (node, isInFor) {
6652
6748
  if (node.type === 1) {
6653
- if (node.once || node.static) {
6654
- node.staticRoot = true;
6749
+ if (node.static || node.once) {
6655
6750
  node.staticInFor = isInFor;
6751
+ }
6752
+ if (node.static) {
6753
+ node.staticRoot = true;
6656
6754
  return
6657
6755
  }
6658
6756
  if (node.children) {
@@ -6695,7 +6793,7 @@ function isDirectChildOfTemplateFor (node) {
6695
6793
 
6696
6794
  /* */
6697
6795
 
6698
- var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*\s*$/;
6796
+ var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
6699
6797
 
6700
6798
  // keyCode aliases
6701
6799
  var keyCodes = {
@@ -6795,6 +6893,7 @@ var transforms$1;
6795
6893
  var dataGenFns;
6796
6894
  var platformDirectives$1;
6797
6895
  var staticRenderFns;
6896
+ var onceCount;
6798
6897
  var currentOptions;
6799
6898
 
6800
6899
  function generate (
@@ -6804,6 +6903,8 @@ function generate (
6804
6903
  // save previous staticRenderFns so generate calls can be nested
6805
6904
  var prevStaticRenderFns = staticRenderFns;
6806
6905
  var currentStaticRenderFns = staticRenderFns = [];
6906
+ var prevOnceCount = onceCount;
6907
+ onceCount = 0;
6807
6908
  currentOptions = options;
6808
6909
  warn$2 = options.warn || baseWarn;
6809
6910
  transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
@@ -6811,6 +6912,7 @@ function generate (
6811
6912
  platformDirectives$1 = options.directives || {};
6812
6913
  var code = ast ? genElement(ast) : '_h("div")';
6813
6914
  staticRenderFns = prevStaticRenderFns;
6915
+ onceCount = prevOnceCount;
6814
6916
  return {
6815
6917
  render: ("with(this){return " + code + "}"),
6816
6918
  staticRenderFns: currentStaticRenderFns
@@ -6819,10 +6921,9 @@ function generate (
6819
6921
 
6820
6922
  function genElement (el) {
6821
6923
  if (el.staticRoot && !el.staticProcessed) {
6822
- // hoist static sub-trees out
6823
- el.staticProcessed = true;
6824
- staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
6825
- return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
6924
+ return genStatic(el)
6925
+ } else if (el.once && !el.onceProcessed) {
6926
+ return genOnce(el)
6826
6927
  } else if (el.for && !el.forProcessed) {
6827
6928
  return genFor(el)
6828
6929
  } else if (el.if && !el.ifProcessed) {
@@ -6835,9 +6936,10 @@ function genElement (el) {
6835
6936
  // component or element
6836
6937
  var code;
6837
6938
  if (el.component) {
6838
- code = genComponent(el);
6939
+ code = genComponent(el.component, el);
6839
6940
  } else {
6840
- var data = genData(el);
6941
+ var data = el.plain ? undefined : genData(el);
6942
+
6841
6943
  var children = el.inlineTemplate ? null : genChildren(el);
6842
6944
  code = "_h('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
6843
6945
  }
@@ -6849,6 +6951,38 @@ function genElement (el) {
6849
6951
  }
6850
6952
  }
6851
6953
 
6954
+ // hoist static sub-trees out
6955
+ function genStatic (el) {
6956
+ el.staticProcessed = true;
6957
+ staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
6958
+ return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
6959
+ }
6960
+
6961
+ // v-once
6962
+ function genOnce (el) {
6963
+ el.onceProcessed = true;
6964
+ if (el.staticInFor) {
6965
+ var key = '';
6966
+ var parent = el.parent;
6967
+ while (parent) {
6968
+ if (parent.for) {
6969
+ key = parent.key;
6970
+ break
6971
+ }
6972
+ parent = parent.parent;
6973
+ }
6974
+ if (!key) {
6975
+ "development" !== 'production' && warn$2(
6976
+ "v-once can only be used inside v-for that is keyed. "
6977
+ );
6978
+ return genElement(el)
6979
+ }
6980
+ return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
6981
+ } else {
6982
+ return genStatic(el)
6983
+ }
6984
+ }
6985
+
6852
6986
  function genIf (el) {
6853
6987
  var exp = el.if;
6854
6988
  el.ifProcessed = true; // avoid recursion
@@ -6874,10 +7008,6 @@ function genFor (el) {
6874
7008
  }
6875
7009
 
6876
7010
  function genData (el) {
6877
- if (el.plain) {
6878
- return
6879
- }
6880
-
6881
7011
  var data = '{';
6882
7012
 
6883
7013
  // directives first.
@@ -6992,14 +7122,13 @@ function genText (text) {
6992
7122
  function genSlot (el) {
6993
7123
  var slotName = el.slotName || '"default"';
6994
7124
  var children = genChildren(el);
6995
- return children
6996
- ? ("_t(" + slotName + "," + children + ")")
6997
- : ("_t(" + slotName + ")")
7125
+ return ("_t(" + slotName + (children ? ("," + children) : '') + ")")
6998
7126
  }
6999
7127
 
7000
- function genComponent (el) {
7128
+ // componentName is el.component, take it as argument to shun flow's pessimistic refinement
7129
+ function genComponent (componentName, el) {
7001
7130
  var children = el.inlineTemplate ? null : genChildren(el);
7002
- return ("_h(" + (el.component) + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
7131
+ return ("_h(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
7003
7132
  }
7004
7133
 
7005
7134
  function genProps (props) {
@@ -7115,8 +7244,9 @@ function transformNode (el, options) {
7115
7244
  if (expression) {
7116
7245
  warn(
7117
7246
  "class=\"" + staticClass + "\": " +
7118
- 'Interpolation inside attributes has been deprecated. ' +
7119
- 'Use v-bind or the colon shorthand instead.'
7247
+ 'Interpolation inside attributes has been removed. ' +
7248
+ 'Use v-bind or the colon shorthand instead. For example, ' +
7249
+ 'instead of <div class="{{ val }}">, use <div :class="val">.'
7120
7250
  );
7121
7251
  }
7122
7252
  }
@@ -7173,6 +7303,97 @@ var modules$1 = [
7173
7303
 
7174
7304
  /* */
7175
7305
 
7306
+ var len;
7307
+ var str;
7308
+ var chr;
7309
+ var index$1;
7310
+ var expressionPos;
7311
+ var expressionEndPos;
7312
+
7313
+ /**
7314
+ * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
7315
+ *
7316
+ * for loop possible cases:
7317
+ *
7318
+ * - test
7319
+ * - test[idx]
7320
+ * - test[test1[idx]]
7321
+ * - test["a"][idx]
7322
+ * - xxx.test[a[a].test1[idx]]
7323
+ * - test.xxx.a["asa"][test1[idx]]
7324
+ *
7325
+ */
7326
+
7327
+ function parseModel (val) {
7328
+ str = val;
7329
+ len = str.length;
7330
+ index$1 = expressionPos = expressionEndPos = 0;
7331
+
7332
+ if (val.indexOf('[') < 0) {
7333
+ return {
7334
+ exp: val,
7335
+ idx: null
7336
+ }
7337
+ }
7338
+
7339
+ while (!eof()) {
7340
+ chr = next();
7341
+ /* istanbul ignore if */
7342
+ if (isStringStart(chr)) {
7343
+ parseString(chr);
7344
+ } else if (chr === 0x5B) {
7345
+ parseBracket(chr);
7346
+ }
7347
+ }
7348
+
7349
+ return {
7350
+ exp: val.substring(0, expressionPos),
7351
+ idx: val.substring(expressionPos + 1, expressionEndPos)
7352
+ }
7353
+ }
7354
+
7355
+ function next () {
7356
+ return str.charCodeAt(++index$1)
7357
+ }
7358
+
7359
+ function eof () {
7360
+ return index$1 >= len
7361
+ }
7362
+
7363
+ function isStringStart (chr) {
7364
+ return chr === 0x22 || chr === 0x27
7365
+ }
7366
+
7367
+ function parseBracket (chr) {
7368
+ var inBracket = 1;
7369
+ expressionPos = index$1;
7370
+ while (!eof()) {
7371
+ chr = next();
7372
+ if (isStringStart(chr)) {
7373
+ parseString(chr);
7374
+ continue
7375
+ }
7376
+ if (chr === 0x5B) { inBracket++; }
7377
+ if (chr === 0x5D) { inBracket--; }
7378
+ if (inBracket === 0) {
7379
+ expressionEndPos = index$1;
7380
+ break
7381
+ }
7382
+ }
7383
+ }
7384
+
7385
+ function parseString (chr) {
7386
+ var stringQuote = chr;
7387
+ while (!eof()) {
7388
+ chr = next();
7389
+ if (chr === stringQuote) {
7390
+ break
7391
+ }
7392
+ }
7393
+ }
7394
+
7395
+ /* */
7396
+
7176
7397
  var warn$3;
7177
7398
 
7178
7399
  function model$1 (
@@ -7195,11 +7416,11 @@ function model$1 (
7195
7416
  }
7196
7417
  }
7197
7418
  if (tag === 'select') {
7198
- genSelect(el, value);
7419
+ genSelect(el, value, modifiers);
7199
7420
  } else if (tag === 'input' && type === 'checkbox') {
7200
- genCheckboxModel(el, value);
7421
+ genCheckboxModel(el, value, modifiers);
7201
7422
  } else if (tag === 'input' && type === 'radio') {
7202
- genRadioModel(el, value);
7423
+ genRadioModel(el, value, modifiers);
7203
7424
  } else {
7204
7425
  genDefaultModel(el, value, modifiers);
7205
7426
  }
@@ -7207,7 +7428,11 @@ function model$1 (
7207
7428
  return true
7208
7429
  }
7209
7430
 
7210
- function genCheckboxModel (el, value) {
7431
+ function genCheckboxModel (
7432
+ el,
7433
+ value,
7434
+ modifiers
7435
+ ) {
7211
7436
  if ("development" !== 'production' &&
7212
7437
  el.attrsMap.checked != null) {
7213
7438
  warn$3(
@@ -7216,6 +7441,7 @@ function genCheckboxModel (el, value) {
7216
7441
  'Declare initial values in the component\'s data option instead.'
7217
7442
  );
7218
7443
  }
7444
+ var number = modifiers && modifiers.number;
7219
7445
  var valueBinding = getBindingAttr(el, 'value') || 'null';
7220
7446
  var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
7221
7447
  var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
@@ -7229,7 +7455,7 @@ function genCheckboxModel (el, value) {
7229
7455
  '$$el=$event.target,' +
7230
7456
  "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
7231
7457
  'if(Array.isArray($$a)){' +
7232
- "var $$v=" + valueBinding + "," +
7458
+ "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
7233
7459
  '$$i=_i($$a,$$v);' +
7234
7460
  "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
7235
7461
  "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
@@ -7238,7 +7464,11 @@ function genCheckboxModel (el, value) {
7238
7464
  );
7239
7465
  }
7240
7466
 
7241
- function genRadioModel (el, value) {
7467
+ function genRadioModel (
7468
+ el,
7469
+ value,
7470
+ modifiers
7471
+ ) {
7242
7472
  if ("development" !== 'production' &&
7243
7473
  el.attrsMap.checked != null) {
7244
7474
  warn$3(
@@ -7247,9 +7477,11 @@ function genRadioModel (el, value) {
7247
7477
  'Declare initial values in the component\'s data option instead.'
7248
7478
  );
7249
7479
  }
7480
+ var number = modifiers && modifiers.number;
7250
7481
  var valueBinding = getBindingAttr(el, 'value') || 'null';
7482
+ valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
7251
7483
  addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
7252
- addHandler(el, 'change', (value + "=" + valueBinding), null, true);
7484
+ addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
7253
7485
  }
7254
7486
 
7255
7487
  function genDefaultModel (
@@ -7286,9 +7518,10 @@ function genDefaultModel (
7286
7518
  var valueExpression = isNative
7287
7519
  ? ("$event.target.value" + (trim ? '.trim()' : ''))
7288
7520
  : "$event";
7289
- var code = number || type === 'number'
7290
- ? (value + "=_n(" + valueExpression + ")")
7291
- : (value + "=" + valueExpression);
7521
+ valueExpression = number || type === 'number'
7522
+ ? ("_n(" + valueExpression + ")")
7523
+ : valueExpression;
7524
+ var code = genAssignmentCode(value, valueExpression);
7292
7525
  if (isNative && needCompositionGuard) {
7293
7526
  code = "if($event.target.composing)return;" + code;
7294
7527
  }
@@ -7305,14 +7538,23 @@ function genDefaultModel (
7305
7538
  addHandler(el, event, code, null, true);
7306
7539
  }
7307
7540
 
7308
- function genSelect (el, value) {
7541
+ function genSelect (
7542
+ el,
7543
+ value,
7544
+ modifiers
7545
+ ) {
7309
7546
  {
7310
7547
  el.children.some(checkOptionWarning);
7311
7548
  }
7312
- var code = value + "=Array.prototype.filter" +
7549
+
7550
+ var number = modifiers && modifiers.number;
7551
+ var assignment = "Array.prototype.filter" +
7313
7552
  ".call($event.target.options,function(o){return o.selected})" +
7314
- ".map(function(o){return \"_value\" in o ? o._value : o.value})" +
7553
+ ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
7554
+ "return " + (number ? '_n(val)' : 'val') + "})" +
7315
7555
  (el.attrsMap.multiple == null ? '[0]' : '');
7556
+
7557
+ var code = genAssignmentCode(value, assignment);
7316
7558
  addHandler(el, 'change', code, null, true);
7317
7559
  }
7318
7560
 
@@ -7330,6 +7572,18 @@ function checkOptionWarning (option) {
7330
7572
  return false
7331
7573
  }
7332
7574
 
7575
+ function genAssignmentCode (value, assignment) {
7576
+ var modelRs = parseModel(value);
7577
+ if (modelRs.idx === null) {
7578
+ return (value + "=" + assignment)
7579
+ } else {
7580
+ return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
7581
+ "if (!Array.isArray($$exp)){" +
7582
+ value + "=" + assignment + "}" +
7583
+ "else{$$exp.splice($$idx, 1, " + assignment + ")}"
7584
+ }
7585
+ }
7586
+
7333
7587
  /* */
7334
7588
 
7335
7589
  function text (el, dir) {
@@ -7444,8 +7698,8 @@ var idToTemplate = cached(function (id) {
7444
7698
  return el && el.innerHTML
7445
7699
  });
7446
7700
 
7447
- var mount = Vue$3.prototype.$mount;
7448
- Vue$3.prototype.$mount = function (
7701
+ var mount = Vue$2.prototype.$mount;
7702
+ Vue$2.prototype.$mount = function (
7449
7703
  el,
7450
7704
  hydrating
7451
7705
  ) {
@@ -7508,8 +7762,8 @@ function getOuterHTML (el) {
7508
7762
  }
7509
7763
  }
7510
7764
 
7511
- Vue$3.compile = compileToFunctions;
7765
+ Vue$2.compile = compileToFunctions;
7512
7766
 
7513
- return Vue$3;
7767
+ return Vue$2;
7514
7768
 
7515
7769
  })));
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vuejs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Butler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-23 00:00:00.000000000 Z
11
+ date: 2016-11-06 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: