vue 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.
- package/dist/vue.esm-browser.js +204 -498
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.global.js +204 -498
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +185 -489
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.global.js +185 -489
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +4 -4
- package/ref-macros.d.ts +38 -16
package/dist/vue.esm-browser.js
CHANGED
|
@@ -1531,41 +1531,33 @@ function registerHMR(instance) {
|
|
|
1531
1531
|
const id = instance.type.__hmrId;
|
|
1532
1532
|
let record = map.get(id);
|
|
1533
1533
|
if (!record) {
|
|
1534
|
-
createRecord(id
|
|
1534
|
+
createRecord(id);
|
|
1535
1535
|
record = map.get(id);
|
|
1536
1536
|
}
|
|
1537
|
-
record.
|
|
1537
|
+
record.add(instance);
|
|
1538
1538
|
}
|
|
1539
1539
|
function unregisterHMR(instance) {
|
|
1540
|
-
map.get(instance.type.__hmrId).
|
|
1540
|
+
map.get(instance.type.__hmrId).delete(instance);
|
|
1541
1541
|
}
|
|
1542
|
-
function createRecord(id
|
|
1543
|
-
if (!component) {
|
|
1544
|
-
warn$1(`HMR API usage is out of date.\n` +
|
|
1545
|
-
`Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +
|
|
1546
|
-
`dependency that handles Vue SFC compilation.`);
|
|
1547
|
-
component = {};
|
|
1548
|
-
}
|
|
1542
|
+
function createRecord(id) {
|
|
1549
1543
|
if (map.has(id)) {
|
|
1550
1544
|
return false;
|
|
1551
1545
|
}
|
|
1552
|
-
map.set(id,
|
|
1553
|
-
component: isClassComponent(component) ? component.__vccOpts : component,
|
|
1554
|
-
instances: new Set()
|
|
1555
|
-
});
|
|
1546
|
+
map.set(id, new Set());
|
|
1556
1547
|
return true;
|
|
1557
1548
|
}
|
|
1549
|
+
function normalizeClassComponent(component) {
|
|
1550
|
+
return isClassComponent(component) ? component.__vccOpts : component;
|
|
1551
|
+
}
|
|
1558
1552
|
function rerender(id, newRender) {
|
|
1559
1553
|
const record = map.get(id);
|
|
1560
|
-
if (!record)
|
|
1554
|
+
if (!record) {
|
|
1561
1555
|
return;
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
// Array.from creates a snapshot which avoids the set being mutated during
|
|
1565
|
-
// updates
|
|
1566
|
-
Array.from(record.instances).forEach(instance => {
|
|
1556
|
+
}
|
|
1557
|
+
[...record].forEach(instance => {
|
|
1567
1558
|
if (newRender) {
|
|
1568
1559
|
instance.render = newRender;
|
|
1560
|
+
normalizeClassComponent(instance.type).render = newRender;
|
|
1569
1561
|
}
|
|
1570
1562
|
instance.renderCache = [];
|
|
1571
1563
|
// this flag forces child components with slot content to update
|
|
@@ -1578,34 +1570,31 @@ function reload(id, newComp) {
|
|
|
1578
1570
|
const record = map.get(id);
|
|
1579
1571
|
if (!record)
|
|
1580
1572
|
return;
|
|
1581
|
-
|
|
1582
|
-
// updates
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
});
|
|
1600
|
-
}
|
|
1601
|
-
Array.from(instances).forEach(instance => {
|
|
1602
|
-
// invalidate options resolution cache
|
|
1573
|
+
newComp = normalizeClassComponent(newComp);
|
|
1574
|
+
// create a snapshot which avoids the set being mutated during updates
|
|
1575
|
+
const instances = [...record];
|
|
1576
|
+
for (const instance of instances) {
|
|
1577
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
1578
|
+
if (!hmrDirtyComponents.has(oldComp)) {
|
|
1579
|
+
// 1. Update existing comp definition to match new one
|
|
1580
|
+
extend(oldComp, newComp);
|
|
1581
|
+
for (const key in oldComp) {
|
|
1582
|
+
if (key !== '__file' && !(key in newComp)) {
|
|
1583
|
+
delete oldComp[key];
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
// 2. mark definition dirty. This forces the renderer to replace the
|
|
1587
|
+
// component on patch.
|
|
1588
|
+
hmrDirtyComponents.add(oldComp);
|
|
1589
|
+
}
|
|
1590
|
+
// 3. invalidate options resolution cache
|
|
1603
1591
|
instance.appContext.optionsCache.delete(instance.type);
|
|
1592
|
+
// 4. actually update
|
|
1604
1593
|
if (instance.ceReload) {
|
|
1605
1594
|
// custom element
|
|
1606
|
-
hmrDirtyComponents.add(
|
|
1595
|
+
hmrDirtyComponents.add(oldComp);
|
|
1607
1596
|
instance.ceReload(newComp.styles);
|
|
1608
|
-
hmrDirtyComponents.delete(
|
|
1597
|
+
hmrDirtyComponents.delete(oldComp);
|
|
1609
1598
|
}
|
|
1610
1599
|
else if (instance.parent) {
|
|
1611
1600
|
// 4. Force the parent instance to re-render. This will cause all updated
|
|
@@ -1630,6 +1619,12 @@ function reload(id, newComp) {
|
|
|
1630
1619
|
else {
|
|
1631
1620
|
console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');
|
|
1632
1621
|
}
|
|
1622
|
+
}
|
|
1623
|
+
// 5. make sure to cleanup dirty hmr components after update
|
|
1624
|
+
queuePostFlushCb(() => {
|
|
1625
|
+
for (const instance of instances) {
|
|
1626
|
+
hmrDirtyComponents.delete(normalizeClassComponent(instance.type));
|
|
1627
|
+
}
|
|
1633
1628
|
});
|
|
1634
1629
|
}
|
|
1635
1630
|
function tryWrap(fn) {
|
|
@@ -1692,335 +1687,6 @@ function devtoolsComponentEmit(component, event, params) {
|
|
|
1692
1687
|
devtools.emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
1693
1688
|
}
|
|
1694
1689
|
|
|
1695
|
-
const deprecationData = {
|
|
1696
|
-
["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
|
|
1697
|
-
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
1698
|
-
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
1699
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
|
|
1700
|
-
},
|
|
1701
|
-
["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
|
|
1702
|
-
message: `Vue detected directives on the mount container. ` +
|
|
1703
|
-
`In Vue 3, the container is no longer considered part of the template ` +
|
|
1704
|
-
`and will not be processed/replaced.`,
|
|
1705
|
-
link: `https://v3.vuejs.org/guide/migration/mount-changes.html`
|
|
1706
|
-
},
|
|
1707
|
-
["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
|
|
1708
|
-
message: `Vue.extend() has been removed in Vue 3. ` +
|
|
1709
|
-
`Use defineComponent() instead.`,
|
|
1710
|
-
link: `https://v3.vuejs.org/api/global-api.html#definecomponent`
|
|
1711
|
-
},
|
|
1712
|
-
["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
|
|
1713
|
-
message: `Vue.prototype is no longer available in Vue 3. ` +
|
|
1714
|
-
`Use app.config.globalProperties instead.`,
|
|
1715
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`
|
|
1716
|
-
},
|
|
1717
|
-
["GLOBAL_SET" /* GLOBAL_SET */]: {
|
|
1718
|
-
message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
|
|
1719
|
-
`Simply use native JavaScript mutations.`
|
|
1720
|
-
},
|
|
1721
|
-
["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
|
|
1722
|
-
message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
1723
|
-
`Simply use native JavaScript mutations.`
|
|
1724
|
-
},
|
|
1725
|
-
["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
|
|
1726
|
-
message: `Vue.observable() has been removed. ` +
|
|
1727
|
-
`Use \`import { reactive } from "vue"\` from Composition API instead.`,
|
|
1728
|
-
link: `https://v3.vuejs.org/api/basic-reactivity.html`
|
|
1729
|
-
},
|
|
1730
|
-
["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
|
|
1731
|
-
message: `Vue.util has been removed. Please refactor to avoid its usage ` +
|
|
1732
|
-
`since it was an internal API even in Vue 2.`
|
|
1733
|
-
},
|
|
1734
|
-
["CONFIG_SILENT" /* CONFIG_SILENT */]: {
|
|
1735
|
-
message: `config.silent has been removed because it is not good practice to ` +
|
|
1736
|
-
`intentionally suppress warnings. You can use your browser console's ` +
|
|
1737
|
-
`filter features to focus on relevant messages.`
|
|
1738
|
-
},
|
|
1739
|
-
["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
|
|
1740
|
-
message: `config.devtools has been removed. To enable devtools for ` +
|
|
1741
|
-
`production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
|
|
1742
|
-
link: `https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags`
|
|
1743
|
-
},
|
|
1744
|
-
["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
|
|
1745
|
-
message: `config.keyCodes has been removed. ` +
|
|
1746
|
-
`In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
|
|
1747
|
-
link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
|
|
1748
|
-
},
|
|
1749
|
-
["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
|
|
1750
|
-
message: `config.productionTip has been removed.`,
|
|
1751
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`
|
|
1752
|
-
},
|
|
1753
|
-
["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
|
|
1754
|
-
message: () => {
|
|
1755
|
-
let msg = `config.ignoredElements has been removed.`;
|
|
1756
|
-
if (isRuntimeOnly()) {
|
|
1757
|
-
msg += ` Pass the "isCustomElement" option to @vue/compiler-dom instead.`;
|
|
1758
|
-
}
|
|
1759
|
-
else {
|
|
1760
|
-
msg += ` Use config.isCustomElement instead.`;
|
|
1761
|
-
}
|
|
1762
|
-
return msg;
|
|
1763
|
-
},
|
|
1764
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
|
|
1765
|
-
},
|
|
1766
|
-
["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
|
|
1767
|
-
// this warning is only relevant in the full build when using runtime
|
|
1768
|
-
// compilation, so it's put in the runtime compatConfig list.
|
|
1769
|
-
message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
|
|
1770
|
-
`"preserve". To suppress this warning, provide an explicit value for ` +
|
|
1771
|
-
`\`config.compilerOptions.whitespace\`.`
|
|
1772
|
-
},
|
|
1773
|
-
["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
|
|
1774
|
-
message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
|
|
1775
|
-
`Use custom merge functions instead.`
|
|
1776
|
-
},
|
|
1777
|
-
["INSTANCE_SET" /* INSTANCE_SET */]: {
|
|
1778
|
-
message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
|
|
1779
|
-
`Simply use native JavaScript mutations.`
|
|
1780
|
-
},
|
|
1781
|
-
["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
|
|
1782
|
-
message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
1783
|
-
`Simply use native JavaScript mutations.`
|
|
1784
|
-
},
|
|
1785
|
-
["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
|
|
1786
|
-
message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
|
|
1787
|
-
link: `https://v3.vuejs.org/api/application-api.html#unmount`
|
|
1788
|
-
},
|
|
1789
|
-
["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
|
|
1790
|
-
message: `vm.$on/$once/$off() have been removed. ` +
|
|
1791
|
-
`Use an external event emitter library instead.`,
|
|
1792
|
-
link: `https://v3.vuejs.org/guide/migration/events-api.html`
|
|
1793
|
-
},
|
|
1794
|
-
["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
|
|
1795
|
-
message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
|
|
1796
|
-
`use the "vnode" prefix instead of "hook:". For example, @${event} ` +
|
|
1797
|
-
`should be changed to @vnode-${event.slice(5)}. ` +
|
|
1798
|
-
`From JavaScript, use Composition API to dynamically register lifecycle ` +
|
|
1799
|
-
`hooks.`,
|
|
1800
|
-
link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`
|
|
1801
|
-
},
|
|
1802
|
-
["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
|
|
1803
|
-
message: `vm.$children has been removed. Consider refactoring your logic ` +
|
|
1804
|
-
`to avoid relying on direct access to child components.`,
|
|
1805
|
-
link: `https://v3.vuejs.org/guide/migration/children.html`
|
|
1806
|
-
},
|
|
1807
|
-
["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
|
|
1808
|
-
message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
|
|
1809
|
-
`included in vm.$attrs and it is no longer necessary to separately use ` +
|
|
1810
|
-
`v-on="$listeners" if you are already using v-bind="$attrs". ` +
|
|
1811
|
-
`(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
|
|
1812
|
-
link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
|
|
1813
|
-
},
|
|
1814
|
-
["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
|
|
1815
|
-
message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
|
|
1816
|
-
link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
|
|
1817
|
-
},
|
|
1818
|
-
["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
1819
|
-
message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
|
|
1820
|
-
`relying on class/style fallthrough from parent. In Vue 3, class/style ` +
|
|
1821
|
-
`are now included in $attrs and will no longer fallthrough when ` +
|
|
1822
|
-
`inheritAttrs is false. If you are already using v-bind="$attrs" on ` +
|
|
1823
|
-
`component root it should render the same end result. ` +
|
|
1824
|
-
`If you are binding $attrs to a non-root element and expecting ` +
|
|
1825
|
-
`class/style to fallthrough on root, you will need to now manually bind ` +
|
|
1826
|
-
`them on root via :class="$attrs.class".`,
|
|
1827
|
-
link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`
|
|
1828
|
-
},
|
|
1829
|
-
["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
|
|
1830
|
-
message: `The "data" option can no longer be a plain object. ` +
|
|
1831
|
-
`Always use a function.`,
|
|
1832
|
-
link: `https://v3.vuejs.org/guide/migration/data-option.html`
|
|
1833
|
-
},
|
|
1834
|
-
["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
|
|
1835
|
-
message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
|
|
1836
|
-
`In Vue 3, data keys are merged shallowly and will override one another.`,
|
|
1837
|
-
link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`
|
|
1838
|
-
},
|
|
1839
|
-
["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
|
|
1840
|
-
message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
|
|
1841
|
-
},
|
|
1842
|
-
["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
|
|
1843
|
-
message: `\`destroyed\` has been renamed to \`unmounted\`.`
|
|
1844
|
-
},
|
|
1845
|
-
["WATCH_ARRAY" /* WATCH_ARRAY */]: {
|
|
1846
|
-
message: `"watch" option or vm.$watch on an array value will no longer ` +
|
|
1847
|
-
`trigger on array mutation unless the "deep" option is specified. ` +
|
|
1848
|
-
`If current usage is intended, you can disable the compat behavior and ` +
|
|
1849
|
-
`suppress this warning with:` +
|
|
1850
|
-
`\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
|
|
1851
|
-
link: `https://v3.vuejs.org/guide/migration/watch.html`
|
|
1852
|
-
},
|
|
1853
|
-
["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
|
|
1854
|
-
message: (key) => `props default value function no longer has access to "this". The compat ` +
|
|
1855
|
-
`build only offers access to this.$options.` +
|
|
1856
|
-
`(found in prop "${key}")`,
|
|
1857
|
-
link: `https://v3.vuejs.org/guide/migration/props-default-this.html`
|
|
1858
|
-
},
|
|
1859
|
-
["CUSTOM_DIR" /* CUSTOM_DIR */]: {
|
|
1860
|
-
message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
|
|
1861
|
-
`Use "${newHook}" instead.`,
|
|
1862
|
-
link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
|
|
1863
|
-
},
|
|
1864
|
-
["V_FOR_REF" /* V_FOR_REF */]: {
|
|
1865
|
-
message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
|
|
1866
|
-
`Consider using function refs or refactor to avoid ref usage altogether.`,
|
|
1867
|
-
link: `https://v3.vuejs.org/guide/migration/array-refs.html`
|
|
1868
|
-
},
|
|
1869
|
-
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
1870
|
-
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
1871
|
-
`Use kebab-case key name modifiers instead.`,
|
|
1872
|
-
link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
|
|
1873
|
-
},
|
|
1874
|
-
["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
|
|
1875
|
-
message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
|
|
1876
|
-
`${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
|
|
1877
|
-
`use \`null\` or \`undefined\` instead. If the usage is intended, ` +
|
|
1878
|
-
`you can disable the compat behavior and suppress this warning with:` +
|
|
1879
|
-
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
|
|
1880
|
-
link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
|
|
1881
|
-
},
|
|
1882
|
-
["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
|
|
1883
|
-
message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
|
|
1884
|
-
`${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
|
|
1885
|
-
`Always use explicit "true" or "false" values for enumerated attributes. ` +
|
|
1886
|
-
`If the usage is intended, ` +
|
|
1887
|
-
`you can disable the compat behavior and suppress this warning with:` +
|
|
1888
|
-
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
1889
|
-
link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
|
|
1890
|
-
},
|
|
1891
|
-
["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
|
|
1892
|
-
message: `` // this feature cannot be runtime-detected
|
|
1893
|
-
},
|
|
1894
|
-
["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
|
|
1895
|
-
message: `<TransitionGroup> no longer renders a root <span> element by ` +
|
|
1896
|
-
`default if no "tag" prop is specified. If you do not rely on the span ` +
|
|
1897
|
-
`for styling, you can disable the compat behavior and suppress this ` +
|
|
1898
|
-
`warning with:` +
|
|
1899
|
-
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
1900
|
-
link: `https://v3.vuejs.org/guide/migration/transition-group.html`
|
|
1901
|
-
},
|
|
1902
|
-
["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
|
|
1903
|
-
message: (comp) => {
|
|
1904
|
-
const name = getComponentName(comp);
|
|
1905
|
-
return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
|
|
1906
|
-
`in Vue 3. Plain functions will be treated as functional components in ` +
|
|
1907
|
-
`non-compat build. If you have already migrated all async component ` +
|
|
1908
|
-
`usage and intend to use plain functions for functional components, ` +
|
|
1909
|
-
`you can disable the compat behavior and suppress this ` +
|
|
1910
|
-
`warning with:` +
|
|
1911
|
-
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
|
|
1912
|
-
},
|
|
1913
|
-
link: `https://v3.vuejs.org/guide/migration/async-components.html`
|
|
1914
|
-
},
|
|
1915
|
-
["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
|
|
1916
|
-
message: (comp) => {
|
|
1917
|
-
const name = getComponentName(comp);
|
|
1918
|
-
return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
|
|
1919
|
-
`option has been removed. NOTE: Before migrating to use plain ` +
|
|
1920
|
-
`functions for functional components, first make sure that all async ` +
|
|
1921
|
-
`components usage have been migrated and its compat behavior has ` +
|
|
1922
|
-
`been disabled.`);
|
|
1923
|
-
},
|
|
1924
|
-
link: `https://v3.vuejs.org/guide/migration/functional-components.html`
|
|
1925
|
-
},
|
|
1926
|
-
["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
|
|
1927
|
-
message: (comp) => {
|
|
1928
|
-
const configMsg = `opt-in to ` +
|
|
1929
|
-
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
1930
|
-
if (comp.props &&
|
|
1931
|
-
(isArray(comp.props)
|
|
1932
|
-
? comp.props.includes('modelValue')
|
|
1933
|
-
: hasOwn(comp.props, 'modelValue'))) {
|
|
1934
|
-
return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
|
|
1935
|
-
`is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
|
|
1936
|
-
}
|
|
1937
|
-
return (`v-model usage on component has changed in Vue 3. Component that expects ` +
|
|
1938
|
-
`to work with v-model should now use the "modelValue" prop and emit the ` +
|
|
1939
|
-
`"update:modelValue" event. You can update the usage and then ${configMsg}`);
|
|
1940
|
-
},
|
|
1941
|
-
link: `https://v3.vuejs.org/guide/migration/v-model.html`
|
|
1942
|
-
},
|
|
1943
|
-
["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
|
|
1944
|
-
message: `Vue 3's render function API has changed. ` +
|
|
1945
|
-
`You can opt-in to the new API with:` +
|
|
1946
|
-
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
|
|
1947
|
-
`\n (This can also be done per-component via the "compatConfig" option.)`,
|
|
1948
|
-
link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
|
|
1949
|
-
},
|
|
1950
|
-
["FILTERS" /* FILTERS */]: {
|
|
1951
|
-
message: `filters have been removed in Vue 3. ` +
|
|
1952
|
-
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
|
|
1953
|
-
`Use method calls or computed properties instead.`,
|
|
1954
|
-
link: `https://v3.vuejs.org/guide/migration/filters.html`
|
|
1955
|
-
},
|
|
1956
|
-
["PRIVATE_APIS" /* PRIVATE_APIS */]: {
|
|
1957
|
-
message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
|
|
1958
|
-
`If you are seeing this warning only due to a dependency, you can ` +
|
|
1959
|
-
`suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1962
|
-
const instanceWarned = Object.create(null);
|
|
1963
|
-
const warnCount = Object.create(null);
|
|
1964
|
-
function warnDeprecation(key, instance, ...args) {
|
|
1965
|
-
instance = instance || getCurrentInstance();
|
|
1966
|
-
// check user config
|
|
1967
|
-
const config = getCompatConfigForKey(key, instance);
|
|
1968
|
-
if (config === 'suppress-warning') {
|
|
1969
|
-
return;
|
|
1970
|
-
}
|
|
1971
|
-
const dupKey = key + args.join('');
|
|
1972
|
-
let compId = instance && formatComponentName(instance, instance.type);
|
|
1973
|
-
if (compId === 'Anonymous' && instance) {
|
|
1974
|
-
compId = instance.uid;
|
|
1975
|
-
}
|
|
1976
|
-
// skip if the same warning is emitted for the same component type
|
|
1977
|
-
const componentDupKey = dupKey + compId;
|
|
1978
|
-
if (componentDupKey in instanceWarned) {
|
|
1979
|
-
return;
|
|
1980
|
-
}
|
|
1981
|
-
instanceWarned[componentDupKey] = true;
|
|
1982
|
-
// same warning, but different component. skip the long message and just
|
|
1983
|
-
// log the key and count.
|
|
1984
|
-
if (dupKey in warnCount) {
|
|
1985
|
-
warn$1(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
|
|
1986
|
-
return;
|
|
1987
|
-
}
|
|
1988
|
-
warnCount[dupKey] = 0;
|
|
1989
|
-
const { message, link } = deprecationData[key];
|
|
1990
|
-
warn$1(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
|
|
1991
|
-
if (!isCompatEnabled(key, instance, true)) {
|
|
1992
|
-
console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
|
|
1993
|
-
`lead to runtime errors.`);
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
const globalCompatConfig = {
|
|
1997
|
-
MODE: 2
|
|
1998
|
-
};
|
|
1999
|
-
function getCompatConfigForKey(key, instance) {
|
|
2000
|
-
const instanceConfig = instance && instance.type.compatConfig;
|
|
2001
|
-
if (instanceConfig && key in instanceConfig) {
|
|
2002
|
-
return instanceConfig[key];
|
|
2003
|
-
}
|
|
2004
|
-
return globalCompatConfig[key];
|
|
2005
|
-
}
|
|
2006
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
2007
|
-
// skip compat for built-in components
|
|
2008
|
-
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
2009
|
-
return false;
|
|
2010
|
-
}
|
|
2011
|
-
const rawMode = getCompatConfigForKey('MODE', instance) || 2;
|
|
2012
|
-
const val = getCompatConfigForKey(key, instance);
|
|
2013
|
-
const mode = isFunction(rawMode)
|
|
2014
|
-
? rawMode(instance && instance.type)
|
|
2015
|
-
: rawMode;
|
|
2016
|
-
if (mode === 2) {
|
|
2017
|
-
return val !== false;
|
|
2018
|
-
}
|
|
2019
|
-
else {
|
|
2020
|
-
return val === true || val === 'suppress-warning';
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
1690
|
function emit(instance, event, ...rawArgs) {
|
|
2025
1691
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
2026
1692
|
{
|
|
@@ -2246,12 +1912,12 @@ function markAttrsAccessed() {
|
|
|
2246
1912
|
function renderComponentRoot(instance) {
|
|
2247
1913
|
const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
|
|
2248
1914
|
let result;
|
|
1915
|
+
let fallthroughAttrs;
|
|
2249
1916
|
const prev = setCurrentRenderingInstance(instance);
|
|
2250
1917
|
{
|
|
2251
1918
|
accessedAttrs = false;
|
|
2252
1919
|
}
|
|
2253
1920
|
try {
|
|
2254
|
-
let fallthroughAttrs;
|
|
2255
1921
|
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
2256
1922
|
// withProxy is a proxy with a different `has` trap only for
|
|
2257
1923
|
// runtime-compiled render functions using `with` block.
|
|
@@ -2282,97 +1948,91 @@ function renderComponentRoot(instance) {
|
|
|
2282
1948
|
? attrs
|
|
2283
1949
|
: getFunctionalFallthrough(attrs);
|
|
2284
1950
|
}
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
1951
|
+
}
|
|
1952
|
+
catch (err) {
|
|
1953
|
+
blockStack.length = 0;
|
|
1954
|
+
handleError(err, instance, 1 /* RENDER_FUNCTION */);
|
|
1955
|
+
result = createVNode(Comment);
|
|
1956
|
+
}
|
|
1957
|
+
// attr merging
|
|
1958
|
+
// in dev mode, comments are preserved, and it's possible for a template
|
|
1959
|
+
// to have comments along side the root element which makes it a fragment
|
|
1960
|
+
let root = result;
|
|
1961
|
+
let setRoot = undefined;
|
|
1962
|
+
if (result.patchFlag > 0 &&
|
|
1963
|
+
result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
1964
|
+
[root, setRoot] = getChildRoot(result);
|
|
1965
|
+
}
|
|
1966
|
+
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
1967
|
+
const keys = Object.keys(fallthroughAttrs);
|
|
1968
|
+
const { shapeFlag } = root;
|
|
1969
|
+
if (keys.length) {
|
|
1970
|
+
if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
1971
|
+
if (propsOptions && keys.some(isModelListener)) {
|
|
1972
|
+
// If a v-model listener (onUpdate:xxx) has a corresponding declared
|
|
1973
|
+
// prop, it indicates this component expects to handle v-model and
|
|
1974
|
+
// it should not fallthrough.
|
|
1975
|
+
// related: #1543, #1643, #1989
|
|
1976
|
+
fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
|
|
1977
|
+
}
|
|
1978
|
+
root = cloneVNode(root, fallthroughAttrs);
|
|
1979
|
+
}
|
|
1980
|
+
else if (!accessedAttrs && root.type !== Comment) {
|
|
1981
|
+
const allAttrs = Object.keys(attrs);
|
|
1982
|
+
const eventAttrs = [];
|
|
1983
|
+
const extraAttrs = [];
|
|
1984
|
+
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
1985
|
+
const key = allAttrs[i];
|
|
1986
|
+
if (isOn(key)) {
|
|
1987
|
+
// ignore v-model handlers when they fail to fallthrough
|
|
1988
|
+
if (!isModelListener(key)) {
|
|
1989
|
+
// remove `on`, lowercase first letter to reflect event casing
|
|
1990
|
+
// accurately
|
|
1991
|
+
eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
2326
1992
|
}
|
|
2327
1993
|
}
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
`${extraAttrs.join(', ')}) ` +
|
|
2331
|
-
`were passed to component but could not be automatically inherited ` +
|
|
2332
|
-
`because component renders fragment or text root nodes.`);
|
|
2333
|
-
}
|
|
2334
|
-
if (eventAttrs.length) {
|
|
2335
|
-
warn$1(`Extraneous non-emits event listeners (` +
|
|
2336
|
-
`${eventAttrs.join(', ')}) ` +
|
|
2337
|
-
`were passed to component but could not be automatically inherited ` +
|
|
2338
|
-
`because component renders fragment or text root nodes. ` +
|
|
2339
|
-
`If the listener is intended to be a component custom event listener only, ` +
|
|
2340
|
-
`declare it using the "emits" option.`);
|
|
1994
|
+
else {
|
|
1995
|
+
extraAttrs.push(key);
|
|
2341
1996
|
}
|
|
2342
1997
|
}
|
|
1998
|
+
if (extraAttrs.length) {
|
|
1999
|
+
warn$1(`Extraneous non-props attributes (` +
|
|
2000
|
+
`${extraAttrs.join(', ')}) ` +
|
|
2001
|
+
`were passed to component but could not be automatically inherited ` +
|
|
2002
|
+
`because component renders fragment or text root nodes.`);
|
|
2003
|
+
}
|
|
2004
|
+
if (eventAttrs.length) {
|
|
2005
|
+
warn$1(`Extraneous non-emits event listeners (` +
|
|
2006
|
+
`${eventAttrs.join(', ')}) ` +
|
|
2007
|
+
`were passed to component but could not be automatically inherited ` +
|
|
2008
|
+
`because component renders fragment or text root nodes. ` +
|
|
2009
|
+
`If the listener is intended to be a component custom event listener only, ` +
|
|
2010
|
+
`declare it using the "emits" option.`);
|
|
2011
|
+
}
|
|
2343
2012
|
}
|
|
2344
2013
|
}
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
if (true && !isElementRoot(root)) {
|
|
2352
|
-
warn$1(`Runtime directive used on component with non-element root node. ` +
|
|
2353
|
-
`The directives will not function as intended.`);
|
|
2354
|
-
}
|
|
2355
|
-
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
2356
|
-
}
|
|
2357
|
-
// inherit transition data
|
|
2358
|
-
if (vnode.transition) {
|
|
2359
|
-
if (true && !isElementRoot(root)) {
|
|
2360
|
-
warn$1(`Component inside <Transition> renders non-element root node ` +
|
|
2361
|
-
`that cannot be animated.`);
|
|
2362
|
-
}
|
|
2363
|
-
root.transition = vnode.transition;
|
|
2364
|
-
}
|
|
2365
|
-
if (true && setRoot) {
|
|
2366
|
-
setRoot(root);
|
|
2014
|
+
}
|
|
2015
|
+
// inherit directives
|
|
2016
|
+
if (vnode.dirs) {
|
|
2017
|
+
if (!isElementRoot(root)) {
|
|
2018
|
+
warn$1(`Runtime directive used on component with non-element root node. ` +
|
|
2019
|
+
`The directives will not function as intended.`);
|
|
2367
2020
|
}
|
|
2368
|
-
|
|
2369
|
-
|
|
2021
|
+
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
2022
|
+
}
|
|
2023
|
+
// inherit transition data
|
|
2024
|
+
if (vnode.transition) {
|
|
2025
|
+
if (!isElementRoot(root)) {
|
|
2026
|
+
warn$1(`Component inside <Transition> renders non-element root node ` +
|
|
2027
|
+
`that cannot be animated.`);
|
|
2370
2028
|
}
|
|
2029
|
+
root.transition = vnode.transition;
|
|
2371
2030
|
}
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2031
|
+
if (setRoot) {
|
|
2032
|
+
setRoot(root);
|
|
2033
|
+
}
|
|
2034
|
+
else {
|
|
2035
|
+
result = root;
|
|
2376
2036
|
}
|
|
2377
2037
|
setCurrentRenderingInstance(prev);
|
|
2378
2038
|
return result;
|
|
@@ -2907,8 +2567,8 @@ function normalizeSuspenseChildren(vnode) {
|
|
|
2907
2567
|
function normalizeSuspenseSlot(s) {
|
|
2908
2568
|
let block;
|
|
2909
2569
|
if (isFunction(s)) {
|
|
2910
|
-
const
|
|
2911
|
-
if (
|
|
2570
|
+
const trackBlock = isBlockTreeEnabled && s._c;
|
|
2571
|
+
if (trackBlock) {
|
|
2912
2572
|
// disableTracking: false
|
|
2913
2573
|
// allow block tracking for compiled slots
|
|
2914
2574
|
// (see ./componentRenderContext.ts)
|
|
@@ -2916,7 +2576,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
2916
2576
|
openBlock();
|
|
2917
2577
|
}
|
|
2918
2578
|
s = s();
|
|
2919
|
-
if (
|
|
2579
|
+
if (trackBlock) {
|
|
2920
2580
|
s._d = true;
|
|
2921
2581
|
block = currentBlock;
|
|
2922
2582
|
closeBlock();
|
|
@@ -7012,7 +6672,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
7012
6672
|
return Component;
|
|
7013
6673
|
}
|
|
7014
6674
|
if (warnMissing && !res) {
|
|
7015
|
-
|
|
6675
|
+
const extra = type === COMPONENTS
|
|
6676
|
+
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
6677
|
+
`component resolution via compilerOptions.isCustomElement.`
|
|
6678
|
+
: ``;
|
|
6679
|
+
warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
7016
6680
|
}
|
|
7017
6681
|
return res;
|
|
7018
6682
|
}
|
|
@@ -7867,17 +7531,19 @@ function exposePropsOnRenderContext(instance) {
|
|
|
7867
7531
|
function exposeSetupStateOnRenderContext(instance) {
|
|
7868
7532
|
const { ctx, setupState } = instance;
|
|
7869
7533
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
7870
|
-
if (!setupState.__isScriptSetup
|
|
7871
|
-
|
|
7872
|
-
`
|
|
7873
|
-
|
|
7534
|
+
if (!setupState.__isScriptSetup) {
|
|
7535
|
+
if (key[0] === '$' || key[0] === '_') {
|
|
7536
|
+
warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
7537
|
+
`which are reserved prefixes for Vue internals.`);
|
|
7538
|
+
return;
|
|
7539
|
+
}
|
|
7540
|
+
Object.defineProperty(ctx, key, {
|
|
7541
|
+
enumerable: true,
|
|
7542
|
+
configurable: true,
|
|
7543
|
+
get: () => setupState[key],
|
|
7544
|
+
set: NOOP
|
|
7545
|
+
});
|
|
7874
7546
|
}
|
|
7875
|
-
Object.defineProperty(ctx, key, {
|
|
7876
|
-
enumerable: true,
|
|
7877
|
-
configurable: true,
|
|
7878
|
-
get: () => setupState[key],
|
|
7879
|
-
set: NOOP
|
|
7880
|
-
});
|
|
7881
7547
|
});
|
|
7882
7548
|
}
|
|
7883
7549
|
|
|
@@ -8621,11 +8287,18 @@ function flushJobs(seen) {
|
|
|
8621
8287
|
// 2. If a component is unmounted during a parent component's update,
|
|
8622
8288
|
// its update can be skipped.
|
|
8623
8289
|
queue.sort((a, b) => getId(a) - getId(b));
|
|
8290
|
+
// conditional usage of checkRecursiveUpdate must be determined out of
|
|
8291
|
+
// try ... catch block since Rollup by default de-optimizes treeshaking
|
|
8292
|
+
// inside try-catch. This can leave all warning code unshaked. Although
|
|
8293
|
+
// they would get eventually shaken by a minifier like terser, some minifiers
|
|
8294
|
+
// would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
|
|
8295
|
+
const check = (job) => checkRecursiveUpdates(seen, job)
|
|
8296
|
+
;
|
|
8624
8297
|
try {
|
|
8625
8298
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
8626
8299
|
const job = queue[flushIndex];
|
|
8627
8300
|
if (job && job.active !== false) {
|
|
8628
|
-
if (true &&
|
|
8301
|
+
if (true && check(job)) {
|
|
8629
8302
|
continue;
|
|
8630
8303
|
}
|
|
8631
8304
|
// console.log(`running:`, job.id)
|
|
@@ -8956,7 +8629,7 @@ function defineExpose(exposed) {
|
|
|
8956
8629
|
}
|
|
8957
8630
|
/**
|
|
8958
8631
|
* Vue `<script setup>` compiler macro for providing props default values when
|
|
8959
|
-
* using type-based `defineProps`
|
|
8632
|
+
* using type-based `defineProps` declaration.
|
|
8960
8633
|
*
|
|
8961
8634
|
* Example usage:
|
|
8962
8635
|
* ```ts
|
|
@@ -9305,7 +8978,7 @@ function isMemoSame(cached, memo) {
|
|
|
9305
8978
|
}
|
|
9306
8979
|
|
|
9307
8980
|
// Core API ------------------------------------------------------------------
|
|
9308
|
-
const version = "3.2.
|
|
8981
|
+
const version = "3.2.12";
|
|
9309
8982
|
/**
|
|
9310
8983
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
9311
8984
|
* @internal
|
|
@@ -9427,19 +9100,13 @@ function patchClass(el, value, isSVG) {
|
|
|
9427
9100
|
|
|
9428
9101
|
function patchStyle(el, prev, next) {
|
|
9429
9102
|
const style = el.style;
|
|
9103
|
+
const currentDisplay = style.display;
|
|
9430
9104
|
if (!next) {
|
|
9431
9105
|
el.removeAttribute('style');
|
|
9432
9106
|
}
|
|
9433
9107
|
else if (isString(next)) {
|
|
9434
9108
|
if (prev !== next) {
|
|
9435
|
-
const current = style.display;
|
|
9436
9109
|
style.cssText = next;
|
|
9437
|
-
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9438
|
-
// so we always keep the current `display` value regardless of the `style` value,
|
|
9439
|
-
// thus handing over control to `v-show`.
|
|
9440
|
-
if ('_vod' in el) {
|
|
9441
|
-
style.display = current;
|
|
9442
|
-
}
|
|
9443
9110
|
}
|
|
9444
9111
|
}
|
|
9445
9112
|
else {
|
|
@@ -9454,6 +9121,12 @@ function patchStyle(el, prev, next) {
|
|
|
9454
9121
|
}
|
|
9455
9122
|
}
|
|
9456
9123
|
}
|
|
9124
|
+
// indicates that the `display` of the element is controlled by `v-show`,
|
|
9125
|
+
// so we always keep the current `display` value regardless of the `style` value,
|
|
9126
|
+
// thus handing over control to `v-show`.
|
|
9127
|
+
if ('_vod' in el) {
|
|
9128
|
+
style.display = currentDisplay;
|
|
9129
|
+
}
|
|
9457
9130
|
}
|
|
9458
9131
|
const importantRE = /\s*!important$/;
|
|
9459
9132
|
function setStyle(style, name, val) {
|
|
@@ -9787,6 +9460,7 @@ class VueElement extends BaseClass {
|
|
|
9787
9460
|
this._instance = null;
|
|
9788
9461
|
this._connected = false;
|
|
9789
9462
|
this._resolved = false;
|
|
9463
|
+
this._numberProps = null;
|
|
9790
9464
|
if (this.shadowRoot && hydrate) {
|
|
9791
9465
|
hydrate(this._createVNode(), this.shadowRoot);
|
|
9792
9466
|
}
|
|
@@ -9802,18 +9476,17 @@ class VueElement extends BaseClass {
|
|
|
9802
9476
|
this._setAttr(this.attributes[i].name);
|
|
9803
9477
|
}
|
|
9804
9478
|
// watch future attr changes
|
|
9805
|
-
|
|
9479
|
+
new MutationObserver(mutations => {
|
|
9806
9480
|
for (const m of mutations) {
|
|
9807
9481
|
this._setAttr(m.attributeName);
|
|
9808
9482
|
}
|
|
9809
|
-
});
|
|
9810
|
-
observer.observe(this, { attributes: true });
|
|
9483
|
+
}).observe(this, { attributes: true });
|
|
9811
9484
|
}
|
|
9812
9485
|
connectedCallback() {
|
|
9813
9486
|
this._connected = true;
|
|
9814
9487
|
if (!this._instance) {
|
|
9815
9488
|
this._resolveDef();
|
|
9816
|
-
|
|
9489
|
+
this._update();
|
|
9817
9490
|
}
|
|
9818
9491
|
}
|
|
9819
9492
|
disconnectedCallback() {
|
|
@@ -9834,15 +9507,31 @@ class VueElement extends BaseClass {
|
|
|
9834
9507
|
}
|
|
9835
9508
|
const resolve = (def) => {
|
|
9836
9509
|
this._resolved = true;
|
|
9510
|
+
const { props, styles } = def;
|
|
9511
|
+
const hasOptions = !isArray(props);
|
|
9512
|
+
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
|
|
9513
|
+
// cast Number-type props set before resolve
|
|
9514
|
+
let numberProps;
|
|
9515
|
+
if (hasOptions) {
|
|
9516
|
+
for (const key in this._props) {
|
|
9517
|
+
const opt = props[key];
|
|
9518
|
+
if (opt === Number || (opt && opt.type === Number)) {
|
|
9519
|
+
this._props[key] = toNumber(this._props[key]);
|
|
9520
|
+
(numberProps || (numberProps = Object.create(null)))[key] = true;
|
|
9521
|
+
}
|
|
9522
|
+
}
|
|
9523
|
+
}
|
|
9524
|
+
if (numberProps) {
|
|
9525
|
+
this._numberProps = numberProps;
|
|
9526
|
+
this._update();
|
|
9527
|
+
}
|
|
9837
9528
|
// check if there are props set pre-upgrade or connect
|
|
9838
9529
|
for (const key of Object.keys(this)) {
|
|
9839
9530
|
if (key[0] !== '_') {
|
|
9840
9531
|
this._setProp(key, this[key]);
|
|
9841
9532
|
}
|
|
9842
9533
|
}
|
|
9843
|
-
const { props, styles } = def;
|
|
9844
9534
|
// defining getter/setters on prototype
|
|
9845
|
-
const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
|
|
9846
9535
|
for (const key of rawKeys.map(camelize)) {
|
|
9847
9536
|
Object.defineProperty(this, key, {
|
|
9848
9537
|
get() {
|
|
@@ -9864,7 +9553,11 @@ class VueElement extends BaseClass {
|
|
|
9864
9553
|
}
|
|
9865
9554
|
}
|
|
9866
9555
|
_setAttr(key) {
|
|
9867
|
-
|
|
9556
|
+
let value = this.getAttribute(key);
|
|
9557
|
+
if (this._numberProps && this._numberProps[key]) {
|
|
9558
|
+
value = toNumber(value);
|
|
9559
|
+
}
|
|
9560
|
+
this._setProp(camelize(key), value, false);
|
|
9868
9561
|
}
|
|
9869
9562
|
/**
|
|
9870
9563
|
* @internal
|
|
@@ -9879,7 +9572,7 @@ class VueElement extends BaseClass {
|
|
|
9879
9572
|
if (val !== this._props[key]) {
|
|
9880
9573
|
this._props[key] = val;
|
|
9881
9574
|
if (this._instance) {
|
|
9882
|
-
|
|
9575
|
+
this._update();
|
|
9883
9576
|
}
|
|
9884
9577
|
// reflect
|
|
9885
9578
|
if (shouldReflect) {
|
|
@@ -9895,6 +9588,9 @@ class VueElement extends BaseClass {
|
|
|
9895
9588
|
}
|
|
9896
9589
|
}
|
|
9897
9590
|
}
|
|
9591
|
+
_update() {
|
|
9592
|
+
render(this._createVNode(), this.shadowRoot);
|
|
9593
|
+
}
|
|
9898
9594
|
_createVNode() {
|
|
9899
9595
|
const vnode = createVNode(this._def, extend({}, this._props));
|
|
9900
9596
|
if (!this._instance) {
|
|
@@ -9915,7 +9611,7 @@ class VueElement extends BaseClass {
|
|
|
9915
9611
|
if (!this._def.__asyncLoader) {
|
|
9916
9612
|
// reload
|
|
9917
9613
|
this._instance = null;
|
|
9918
|
-
|
|
9614
|
+
this._update();
|
|
9919
9615
|
}
|
|
9920
9616
|
};
|
|
9921
9617
|
}
|
|
@@ -11679,7 +11375,7 @@ function makeBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
11679
11375
|
}
|
|
11680
11376
|
}
|
|
11681
11377
|
|
|
11682
|
-
const deprecationData
|
|
11378
|
+
const deprecationData = {
|
|
11683
11379
|
["COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */]: {
|
|
11684
11380
|
message: `Platform-native elements with "is" prop will no longer be ` +
|
|
11685
11381
|
`treated as components in Vue 3 unless the "is" value is explicitly ` +
|
|
@@ -11748,7 +11444,7 @@ function getCompatValue(key, context) {
|
|
|
11748
11444
|
return value;
|
|
11749
11445
|
}
|
|
11750
11446
|
}
|
|
11751
|
-
function isCompatEnabled
|
|
11447
|
+
function isCompatEnabled(key, context) {
|
|
11752
11448
|
const mode = getCompatValue('MODE', context);
|
|
11753
11449
|
const value = getCompatValue(key, context);
|
|
11754
11450
|
// in v3 mode, only enable if explicitly set to true
|
|
@@ -11756,18 +11452,18 @@ function isCompatEnabled$1(key, context) {
|
|
|
11756
11452
|
return mode === 3 ? value === true : value !== false;
|
|
11757
11453
|
}
|
|
11758
11454
|
function checkCompatEnabled(key, context, loc, ...args) {
|
|
11759
|
-
const enabled = isCompatEnabled
|
|
11455
|
+
const enabled = isCompatEnabled(key, context);
|
|
11760
11456
|
if (enabled) {
|
|
11761
|
-
warnDeprecation
|
|
11457
|
+
warnDeprecation(key, context, loc, ...args);
|
|
11762
11458
|
}
|
|
11763
11459
|
return enabled;
|
|
11764
11460
|
}
|
|
11765
|
-
function warnDeprecation
|
|
11461
|
+
function warnDeprecation(key, context, loc, ...args) {
|
|
11766
11462
|
const val = getCompatValue(key, context);
|
|
11767
11463
|
if (val === 'suppress-warning') {
|
|
11768
11464
|
return;
|
|
11769
11465
|
}
|
|
11770
|
-
const { message, link } = deprecationData
|
|
11466
|
+
const { message, link } = deprecationData[key];
|
|
11771
11467
|
const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
|
|
11772
11468
|
const err = new SyntaxError(msg);
|
|
11773
11469
|
err.code = key;
|
|
@@ -12217,6 +11913,13 @@ function parseAttributes(context, type) {
|
|
|
12217
11913
|
emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);
|
|
12218
11914
|
}
|
|
12219
11915
|
const attr = parseAttribute(context, attributeNames);
|
|
11916
|
+
// Trim whitespace between class
|
|
11917
|
+
// https://github.com/vuejs/vue-next/issues/4251
|
|
11918
|
+
if (attr.type === 6 /* ATTRIBUTE */ &&
|
|
11919
|
+
attr.value &&
|
|
11920
|
+
attr.name === 'class') {
|
|
11921
|
+
attr.value.content = attr.value.content.replace(/\s+/g, ' ').trim();
|
|
11922
|
+
}
|
|
12220
11923
|
if (type === 0 /* Start */) {
|
|
12221
11924
|
props.push(attr);
|
|
12222
11925
|
}
|
|
@@ -12279,8 +11982,11 @@ function parseAttribute(context, nameSet) {
|
|
|
12279
11982
|
isStatic = false;
|
|
12280
11983
|
if (!content.endsWith(']')) {
|
|
12281
11984
|
emitError(context, 27 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
|
|
11985
|
+
content = content.substr(1);
|
|
11986
|
+
}
|
|
11987
|
+
else {
|
|
11988
|
+
content = content.substr(1, content.length - 2);
|
|
12282
11989
|
}
|
|
12283
|
-
content = content.substr(1, content.length - 2);
|
|
12284
11990
|
}
|
|
12285
11991
|
else if (isSlot) {
|
|
12286
11992
|
// #1241 special case for v-slot: vuetify relies extensively on slot
|
|
@@ -13715,7 +13421,7 @@ function processExpression(node, context,
|
|
|
13715
13421
|
// function params
|
|
13716
13422
|
asParams = false,
|
|
13717
13423
|
// v-on handler values may contain multiple statements
|
|
13718
|
-
asRawStatements = false) {
|
|
13424
|
+
asRawStatements = false, localVars = Object.create(context.identifiers)) {
|
|
13719
13425
|
{
|
|
13720
13426
|
{
|
|
13721
13427
|
// simple in-browser validation (same logic in 2.x)
|
|
@@ -14989,7 +14695,7 @@ function processSlotOutlet(node, context) {
|
|
|
14989
14695
|
};
|
|
14990
14696
|
}
|
|
14991
14697
|
|
|
14992
|
-
const fnExpRE = /^\s*([\w$_]
|
|
14698
|
+
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
14993
14699
|
const transformOn = (dir, node, context, augmentor) => {
|
|
14994
14700
|
const { loc, modifiers, arg } = dir;
|
|
14995
14701
|
if (!dir.exp && !modifiers.length) {
|