@vue/compat 3.2.8 → 3.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var Vue = (function (exports) {
1
+ var Vue = (function () {
2
2
  'use strict';
3
3
 
4
4
  /**
@@ -1459,41 +1459,33 @@ var Vue = (function (exports) {
1459
1459
  const id = instance.type.__hmrId;
1460
1460
  let record = map.get(id);
1461
1461
  if (!record) {
1462
- createRecord(id, instance.type);
1462
+ createRecord(id);
1463
1463
  record = map.get(id);
1464
1464
  }
1465
- record.instances.add(instance);
1465
+ record.add(instance);
1466
1466
  }
1467
1467
  function unregisterHMR(instance) {
1468
- map.get(instance.type.__hmrId).instances.delete(instance);
1468
+ map.get(instance.type.__hmrId).delete(instance);
1469
1469
  }
1470
- function createRecord(id, component) {
1471
- if (!component) {
1472
- warn$1(`HMR API usage is out of date.\n` +
1473
- `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +
1474
- `dependency that handles Vue SFC compilation.`);
1475
- component = {};
1476
- }
1470
+ function createRecord(id) {
1477
1471
  if (map.has(id)) {
1478
1472
  return false;
1479
1473
  }
1480
- map.set(id, {
1481
- component: isClassComponent(component) ? component.__vccOpts : component,
1482
- instances: new Set()
1483
- });
1474
+ map.set(id, new Set());
1484
1475
  return true;
1485
1476
  }
1477
+ function normalizeClassComponent(component) {
1478
+ return isClassComponent(component) ? component.__vccOpts : component;
1479
+ }
1486
1480
  function rerender(id, newRender) {
1487
1481
  const record = map.get(id);
1488
- if (!record)
1482
+ if (!record) {
1489
1483
  return;
1490
- if (newRender)
1491
- record.component.render = newRender;
1492
- // Array.from creates a snapshot which avoids the set being mutated during
1493
- // updates
1494
- Array.from(record.instances).forEach(instance => {
1484
+ }
1485
+ [...record].forEach(instance => {
1495
1486
  if (newRender) {
1496
1487
  instance.render = newRender;
1488
+ normalizeClassComponent(instance.type).render = newRender;
1497
1489
  }
1498
1490
  instance.renderCache = [];
1499
1491
  // this flag forces child components with slot content to update
@@ -1506,34 +1498,31 @@ var Vue = (function (exports) {
1506
1498
  const record = map.get(id);
1507
1499
  if (!record)
1508
1500
  return;
1509
- // Array.from creates a snapshot which avoids the set being mutated during
1510
- // updates
1511
- const { component, instances } = record;
1512
- if (!hmrDirtyComponents.has(component)) {
1513
- // 1. Update existing comp definition to match new one
1514
- newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;
1515
- extend(component, newComp);
1516
- for (const key in component) {
1517
- if (key !== '__file' && !(key in newComp)) {
1518
- delete component[key];
1519
- }
1520
- }
1521
- // 2. Mark component dirty. This forces the renderer to replace the component
1522
- // on patch.
1523
- hmrDirtyComponents.add(component);
1524
- // 3. Make sure to unmark the component after the reload.
1525
- queuePostFlushCb(() => {
1526
- hmrDirtyComponents.delete(component);
1527
- });
1528
- }
1529
- Array.from(instances).forEach(instance => {
1530
- // invalidate options resolution cache
1501
+ newComp = normalizeClassComponent(newComp);
1502
+ // create a snapshot which avoids the set being mutated during updates
1503
+ const instances = [...record];
1504
+ for (const instance of instances) {
1505
+ const oldComp = normalizeClassComponent(instance.type);
1506
+ if (!hmrDirtyComponents.has(oldComp)) {
1507
+ // 1. Update existing comp definition to match new one
1508
+ extend(oldComp, newComp);
1509
+ for (const key in oldComp) {
1510
+ if (key !== '__file' && !(key in newComp)) {
1511
+ delete oldComp[key];
1512
+ }
1513
+ }
1514
+ // 2. mark definition dirty. This forces the renderer to replace the
1515
+ // component on patch.
1516
+ hmrDirtyComponents.add(oldComp);
1517
+ }
1518
+ // 3. invalidate options resolution cache
1531
1519
  instance.appContext.optionsCache.delete(instance.type);
1520
+ // 4. actually update
1532
1521
  if (instance.ceReload) {
1533
1522
  // custom element
1534
- hmrDirtyComponents.add(component);
1523
+ hmrDirtyComponents.add(oldComp);
1535
1524
  instance.ceReload(newComp.styles);
1536
- hmrDirtyComponents.delete(component);
1525
+ hmrDirtyComponents.delete(oldComp);
1537
1526
  }
1538
1527
  else if (instance.parent) {
1539
1528
  // 4. Force the parent instance to re-render. This will cause all updated
@@ -1558,6 +1547,12 @@ var Vue = (function (exports) {
1558
1547
  else {
1559
1548
  console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');
1560
1549
  }
1550
+ }
1551
+ // 5. make sure to cleanup dirty hmr components after update
1552
+ queuePostFlushCb(() => {
1553
+ for (const instance of instances) {
1554
+ hmrDirtyComponents.delete(normalizeClassComponent(instance.type));
1555
+ }
1561
1556
  });
1562
1557
  }
1563
1558
  function tryWrap(fn) {
@@ -2371,12 +2366,12 @@ var Vue = (function (exports) {
2371
2366
  function renderComponentRoot(instance) {
2372
2367
  const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
2373
2368
  let result;
2369
+ let fallthroughAttrs;
2374
2370
  const prev = setCurrentRenderingInstance(instance);
2375
2371
  {
2376
2372
  accessedAttrs = false;
2377
2373
  }
2378
2374
  try {
2379
- let fallthroughAttrs;
2380
2375
  if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2381
2376
  // withProxy is a proxy with a different `has` trap only for
2382
2377
  // runtime-compiled render functions using `with` block.
@@ -2407,108 +2402,105 @@ var Vue = (function (exports) {
2407
2402
  ? attrs
2408
2403
  : getFunctionalFallthrough(attrs);
2409
2404
  }
2410
- // attr merging
2411
- // in dev mode, comments are preserved, and it's possible for a template
2412
- // to have comments along side the root element which makes it a fragment
2413
- let root = result;
2414
- let setRoot = undefined;
2415
- if (true &&
2416
- result.patchFlag > 0 &&
2417
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2418
- ;
2419
- [root, setRoot] = getChildRoot(result);
2420
- }
2421
- if (fallthroughAttrs && inheritAttrs !== false) {
2422
- const keys = Object.keys(fallthroughAttrs);
2423
- const { shapeFlag } = root;
2424
- if (keys.length) {
2425
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2426
- if (propsOptions && keys.some(isModelListener)) {
2427
- // If a v-model listener (onUpdate:xxx) has a corresponding declared
2428
- // prop, it indicates this component expects to handle v-model and
2429
- // it should not fallthrough.
2430
- // related: #1543, #1643, #1989
2431
- fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2432
- }
2433
- root = cloneVNode(root, fallthroughAttrs);
2434
- }
2435
- else if (true && !accessedAttrs && root.type !== Comment) {
2436
- const allAttrs = Object.keys(attrs);
2437
- const eventAttrs = [];
2438
- const extraAttrs = [];
2439
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2440
- const key = allAttrs[i];
2441
- if (isOn(key)) {
2442
- // ignore v-model handlers when they fail to fallthrough
2443
- if (!isModelListener(key)) {
2444
- // remove `on`, lowercase first letter to reflect event casing
2445
- // accurately
2446
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2447
- }
2448
- }
2449
- else {
2450
- extraAttrs.push(key);
2405
+ }
2406
+ catch (err) {
2407
+ blockStack.length = 0;
2408
+ handleError(err, instance, 1 /* RENDER_FUNCTION */);
2409
+ result = createVNode(Comment);
2410
+ }
2411
+ // attr merging
2412
+ // in dev mode, comments are preserved, and it's possible for a template
2413
+ // to have comments along side the root element which makes it a fragment
2414
+ let root = result;
2415
+ let setRoot = undefined;
2416
+ if (result.patchFlag > 0 &&
2417
+ result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2418
+ [root, setRoot] = getChildRoot(result);
2419
+ }
2420
+ if (fallthroughAttrs && inheritAttrs !== false) {
2421
+ const keys = Object.keys(fallthroughAttrs);
2422
+ const { shapeFlag } = root;
2423
+ if (keys.length) {
2424
+ if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2425
+ if (propsOptions && keys.some(isModelListener)) {
2426
+ // If a v-model listener (onUpdate:xxx) has a corresponding declared
2427
+ // prop, it indicates this component expects to handle v-model and
2428
+ // it should not fallthrough.
2429
+ // related: #1543, #1643, #1989
2430
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2431
+ }
2432
+ root = cloneVNode(root, fallthroughAttrs);
2433
+ }
2434
+ else if (!accessedAttrs && root.type !== Comment) {
2435
+ const allAttrs = Object.keys(attrs);
2436
+ const eventAttrs = [];
2437
+ const extraAttrs = [];
2438
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
2439
+ const key = allAttrs[i];
2440
+ if (isOn(key)) {
2441
+ // ignore v-model handlers when they fail to fallthrough
2442
+ if (!isModelListener(key)) {
2443
+ // remove `on`, lowercase first letter to reflect event casing
2444
+ // accurately
2445
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2451
2446
  }
2452
2447
  }
2453
- if (extraAttrs.length) {
2454
- warn$1(`Extraneous non-props attributes (` +
2455
- `${extraAttrs.join(', ')}) ` +
2456
- `were passed to component but could not be automatically inherited ` +
2457
- `because component renders fragment or text root nodes.`);
2458
- }
2459
- if (eventAttrs.length) {
2460
- warn$1(`Extraneous non-emits event listeners (` +
2461
- `${eventAttrs.join(', ')}) ` +
2462
- `were passed to component but could not be automatically inherited ` +
2463
- `because component renders fragment or text root nodes. ` +
2464
- `If the listener is intended to be a component custom event listener only, ` +
2465
- `declare it using the "emits" option.`);
2448
+ else {
2449
+ extraAttrs.push(key);
2466
2450
  }
2467
2451
  }
2468
- }
2469
- }
2470
- if (true &&
2471
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2472
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2473
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2474
- const { class: cls, style } = vnode.props || {};
2475
- if (cls || style) {
2476
- if (true && inheritAttrs === false) {
2477
- warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
2452
+ if (extraAttrs.length) {
2453
+ warn$1(`Extraneous non-props attributes (` +
2454
+ `${extraAttrs.join(', ')}) ` +
2455
+ `were passed to component but could not be automatically inherited ` +
2456
+ `because component renders fragment or text root nodes.`);
2457
+ }
2458
+ if (eventAttrs.length) {
2459
+ warn$1(`Extraneous non-emits event listeners (` +
2460
+ `${eventAttrs.join(', ')}) ` +
2461
+ `were passed to component but could not be automatically inherited ` +
2462
+ `because component renders fragment or text root nodes. ` +
2463
+ `If the listener is intended to be a component custom event listener only, ` +
2464
+ `declare it using the "emits" option.`);
2478
2465
  }
2479
- root = cloneVNode(root, {
2480
- class: cls,
2481
- style: style
2482
- });
2483
- }
2484
- }
2485
- // inherit directives
2486
- if (vnode.dirs) {
2487
- if (true && !isElementRoot(root)) {
2488
- warn$1(`Runtime directive used on component with non-element root node. ` +
2489
- `The directives will not function as intended.`);
2490
2466
  }
2491
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2492
2467
  }
2493
- // inherit transition data
2494
- if (vnode.transition) {
2495
- if (true && !isElementRoot(root)) {
2496
- warn$1(`Component inside <Transition> renders non-element root node ` +
2497
- `that cannot be animated.`);
2468
+ }
2469
+ if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2470
+ vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2471
+ root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2472
+ const { class: cls, style } = vnode.props || {};
2473
+ if (cls || style) {
2474
+ if (inheritAttrs === false) {
2475
+ warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
2498
2476
  }
2499
- root.transition = vnode.transition;
2477
+ root = cloneVNode(root, {
2478
+ class: cls,
2479
+ style: style
2480
+ });
2500
2481
  }
2501
- if (true && setRoot) {
2502
- setRoot(root);
2482
+ }
2483
+ // inherit directives
2484
+ if (vnode.dirs) {
2485
+ if (!isElementRoot(root)) {
2486
+ warn$1(`Runtime directive used on component with non-element root node. ` +
2487
+ `The directives will not function as intended.`);
2503
2488
  }
2504
- else {
2505
- result = root;
2489
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2490
+ }
2491
+ // inherit transition data
2492
+ if (vnode.transition) {
2493
+ if (!isElementRoot(root)) {
2494
+ warn$1(`Component inside <Transition> renders non-element root node ` +
2495
+ `that cannot be animated.`);
2506
2496
  }
2497
+ root.transition = vnode.transition;
2507
2498
  }
2508
- catch (err) {
2509
- blockStack.length = 0;
2510
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2511
- result = createVNode(Comment);
2499
+ if (setRoot) {
2500
+ setRoot(root);
2501
+ }
2502
+ else {
2503
+ result = root;
2512
2504
  }
2513
2505
  setCurrentRenderingInstance(prev);
2514
2506
  return result;
@@ -3043,8 +3035,8 @@ var Vue = (function (exports) {
3043
3035
  function normalizeSuspenseSlot(s) {
3044
3036
  let block;
3045
3037
  if (isFunction(s)) {
3046
- const isCompiledSlot = s._c;
3047
- if (isCompiledSlot) {
3038
+ const trackBlock = isBlockTreeEnabled && s._c;
3039
+ if (trackBlock) {
3048
3040
  // disableTracking: false
3049
3041
  // allow block tracking for compiled slots
3050
3042
  // (see ./componentRenderContext.ts)
@@ -3052,7 +3044,7 @@ var Vue = (function (exports) {
3052
3044
  openBlock();
3053
3045
  }
3054
3046
  s = s();
3055
- if (isCompiledSlot) {
3047
+ if (trackBlock) {
3056
3048
  s._d = true;
3057
3049
  block = currentBlock;
3058
3050
  closeBlock();
@@ -5208,7 +5200,7 @@ var Vue = (function (exports) {
5208
5200
  return vm;
5209
5201
  }
5210
5202
  }
5211
- Vue.version = "3.2.8";
5203
+ Vue.version = "3.2.12";
5212
5204
  Vue.config = singletonApp.config;
5213
5205
  Vue.use = (p, ...options) => {
5214
5206
  if (p && isFunction(p.install)) {
@@ -7856,7 +7848,11 @@ var Vue = (function (exports) {
7856
7848
  return Component;
7857
7849
  }
7858
7850
  if (warnMissing && !res) {
7859
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);
7851
+ const extra = type === COMPONENTS
7852
+ ? `\nIf this is a native custom element, make sure to exclude it from ` +
7853
+ `component resolution via compilerOptions.isCustomElement.`
7854
+ : ``;
7855
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
7860
7856
  }
7861
7857
  return res;
7862
7858
  }
@@ -9298,17 +9294,19 @@ var Vue = (function (exports) {
9298
9294
  function exposeSetupStateOnRenderContext(instance) {
9299
9295
  const { ctx, setupState } = instance;
9300
9296
  Object.keys(toRaw(setupState)).forEach(key => {
9301
- if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {
9302
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
9303
- `which are reserved prefixes for Vue internals.`);
9304
- return;
9297
+ if (!setupState.__isScriptSetup) {
9298
+ if (key[0] === '$' || key[0] === '_') {
9299
+ warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
9300
+ `which are reserved prefixes for Vue internals.`);
9301
+ return;
9302
+ }
9303
+ Object.defineProperty(ctx, key, {
9304
+ enumerable: true,
9305
+ configurable: true,
9306
+ get: () => setupState[key],
9307
+ set: NOOP
9308
+ });
9305
9309
  }
9306
- Object.defineProperty(ctx, key, {
9307
- enumerable: true,
9308
- configurable: true,
9309
- get: () => setupState[key],
9310
- set: NOOP
9311
- });
9312
9310
  });
9313
9311
  }
9314
9312
 
@@ -10067,11 +10065,18 @@ var Vue = (function (exports) {
10067
10065
  // 2. If a component is unmounted during a parent component's update,
10068
10066
  // its update can be skipped.
10069
10067
  queue.sort((a, b) => getId(a) - getId(b));
10068
+ // conditional usage of checkRecursiveUpdate must be determined out of
10069
+ // try ... catch block since Rollup by default de-optimizes treeshaking
10070
+ // inside try-catch. This can leave all warning code unshaked. Although
10071
+ // they would get eventually shaken by a minifier like terser, some minifiers
10072
+ // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
10073
+ const check = (job) => checkRecursiveUpdates(seen, job)
10074
+ ;
10070
10075
  try {
10071
10076
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
10072
10077
  const job = queue[flushIndex];
10073
10078
  if (job && job.active !== false) {
10074
- if (true && checkRecursiveUpdates(seen, job)) {
10079
+ if (true && check(job)) {
10075
10080
  continue;
10076
10081
  }
10077
10082
  // console.log(`running:`, job.id)
@@ -10415,7 +10420,7 @@ var Vue = (function (exports) {
10415
10420
  }
10416
10421
  /**
10417
10422
  * Vue `<script setup>` compiler macro for providing props default values when
10418
- * using type-based `defineProps` decalration.
10423
+ * using type-based `defineProps` declaration.
10419
10424
  *
10420
10425
  * Example usage:
10421
10426
  * ```ts
@@ -10759,7 +10764,7 @@ var Vue = (function (exports) {
10759
10764
  }
10760
10765
 
10761
10766
  // Core API ------------------------------------------------------------------
10762
- const version = "3.2.8";
10767
+ const version = "3.2.12";
10763
10768
  /**
10764
10769
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
10765
10770
  * @internal
@@ -10888,19 +10893,13 @@ var Vue = (function (exports) {
10888
10893
 
10889
10894
  function patchStyle(el, prev, next) {
10890
10895
  const style = el.style;
10896
+ const currentDisplay = style.display;
10891
10897
  if (!next) {
10892
10898
  el.removeAttribute('style');
10893
10899
  }
10894
10900
  else if (isString(next)) {
10895
10901
  if (prev !== next) {
10896
- const current = style.display;
10897
10902
  style.cssText = next;
10898
- // indicates that the `display` of the element is controlled by `v-show`,
10899
- // so we always keep the current `display` value regardless of the `style` value,
10900
- // thus handing over control to `v-show`.
10901
- if ('_vod' in el) {
10902
- style.display = current;
10903
- }
10904
10903
  }
10905
10904
  }
10906
10905
  else {
@@ -10915,6 +10914,12 @@ var Vue = (function (exports) {
10915
10914
  }
10916
10915
  }
10917
10916
  }
10917
+ // indicates that the `display` of the element is controlled by `v-show`,
10918
+ // so we always keep the current `display` value regardless of the `style` value,
10919
+ // thus handing over control to `v-show`.
10920
+ if ('_vod' in el) {
10921
+ style.display = currentDisplay;
10922
+ }
10918
10923
  }
10919
10924
  const importantRE = /\s*!important$/;
10920
10925
  function setStyle(style, name, val) {
@@ -11285,6 +11290,7 @@ var Vue = (function (exports) {
11285
11290
  this._instance = null;
11286
11291
  this._connected = false;
11287
11292
  this._resolved = false;
11293
+ this._numberProps = null;
11288
11294
  if (this.shadowRoot && hydrate) {
11289
11295
  hydrate(this._createVNode(), this.shadowRoot);
11290
11296
  }
@@ -11300,18 +11306,17 @@ var Vue = (function (exports) {
11300
11306
  this._setAttr(this.attributes[i].name);
11301
11307
  }
11302
11308
  // watch future attr changes
11303
- const observer = new MutationObserver(mutations => {
11309
+ new MutationObserver(mutations => {
11304
11310
  for (const m of mutations) {
11305
11311
  this._setAttr(m.attributeName);
11306
11312
  }
11307
- });
11308
- observer.observe(this, { attributes: true });
11313
+ }).observe(this, { attributes: true });
11309
11314
  }
11310
11315
  connectedCallback() {
11311
11316
  this._connected = true;
11312
11317
  if (!this._instance) {
11313
11318
  this._resolveDef();
11314
- render(this._createVNode(), this.shadowRoot);
11319
+ this._update();
11315
11320
  }
11316
11321
  }
11317
11322
  disconnectedCallback() {
@@ -11332,15 +11337,31 @@ var Vue = (function (exports) {
11332
11337
  }
11333
11338
  const resolve = (def) => {
11334
11339
  this._resolved = true;
11340
+ const { props, styles } = def;
11341
+ const hasOptions = !isArray(props);
11342
+ const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
11343
+ // cast Number-type props set before resolve
11344
+ let numberProps;
11345
+ if (hasOptions) {
11346
+ for (const key in this._props) {
11347
+ const opt = props[key];
11348
+ if (opt === Number || (opt && opt.type === Number)) {
11349
+ this._props[key] = toNumber(this._props[key]);
11350
+ (numberProps || (numberProps = Object.create(null)))[key] = true;
11351
+ }
11352
+ }
11353
+ }
11354
+ if (numberProps) {
11355
+ this._numberProps = numberProps;
11356
+ this._update();
11357
+ }
11335
11358
  // check if there are props set pre-upgrade or connect
11336
11359
  for (const key of Object.keys(this)) {
11337
11360
  if (key[0] !== '_') {
11338
11361
  this._setProp(key, this[key]);
11339
11362
  }
11340
11363
  }
11341
- const { props, styles } = def;
11342
11364
  // defining getter/setters on prototype
11343
- const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
11344
11365
  for (const key of rawKeys.map(camelize)) {
11345
11366
  Object.defineProperty(this, key, {
11346
11367
  get() {
@@ -11362,7 +11383,11 @@ var Vue = (function (exports) {
11362
11383
  }
11363
11384
  }
11364
11385
  _setAttr(key) {
11365
- this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);
11386
+ let value = this.getAttribute(key);
11387
+ if (this._numberProps && this._numberProps[key]) {
11388
+ value = toNumber(value);
11389
+ }
11390
+ this._setProp(camelize(key), value, false);
11366
11391
  }
11367
11392
  /**
11368
11393
  * @internal
@@ -11377,7 +11402,7 @@ var Vue = (function (exports) {
11377
11402
  if (val !== this._props[key]) {
11378
11403
  this._props[key] = val;
11379
11404
  if (this._instance) {
11380
- render(this._createVNode(), this.shadowRoot);
11405
+ this._update();
11381
11406
  }
11382
11407
  // reflect
11383
11408
  if (shouldReflect) {
@@ -11393,6 +11418,9 @@ var Vue = (function (exports) {
11393
11418
  }
11394
11419
  }
11395
11420
  }
11421
+ _update() {
11422
+ render(this._createVNode(), this.shadowRoot);
11423
+ }
11396
11424
  _createVNode() {
11397
11425
  const vnode = createVNode(this._def, extend({}, this._props));
11398
11426
  if (!this._instance) {
@@ -11413,7 +11441,7 @@ var Vue = (function (exports) {
11413
11441
  if (!this._def.__asyncLoader) {
11414
11442
  // reload
11415
11443
  this._instance = null;
11416
- render(this._createVNode(), this.shadowRoot);
11444
+ this._update();
11417
11445
  }
11418
11446
  };
11419
11447
  }
@@ -12669,10 +12697,6 @@ var Vue = (function (exports) {
12669
12697
  }
12670
12698
  });
12671
12699
 
12672
- exports.default = Vue;
12673
-
12674
- Object.defineProperty(exports, '__esModule', { value: true });
12675
-
12676
- return exports;
12700
+ return Vue;
12677
12701
 
12678
- }({}));
12702
+ }());