@vue/compat 3.3.0-alpha.7 → 3.3.0-alpha.9
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.cjs.js +1261 -1199
- package/dist/vue.cjs.prod.js +996 -945
- package/dist/vue.esm-browser.js +1262 -1200
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +1276 -1214
- package/dist/vue.global.js +1261 -1199
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +1261 -1199
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +1275 -1213
- package/dist/vue.runtime.global.js +1260 -1198
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
|
@@ -3488,33 +3488,41 @@ function setActiveBranch(suspense, branch) {
|
|
|
3488
3488
|
}
|
|
3489
3489
|
}
|
|
3490
3490
|
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3491
|
+
const legacyDirectiveHookMap = {
|
|
3492
|
+
beforeMount: "bind",
|
|
3493
|
+
mounted: "inserted",
|
|
3494
|
+
updated: ["update", "componentUpdated"],
|
|
3495
|
+
unmounted: "unbind"
|
|
3496
|
+
};
|
|
3497
|
+
function mapCompatDirectiveHook(name, dir, instance) {
|
|
3498
|
+
const mappedName = legacyDirectiveHookMap[name];
|
|
3499
|
+
if (mappedName) {
|
|
3500
|
+
if (isArray(mappedName)) {
|
|
3501
|
+
const hook = [];
|
|
3502
|
+
mappedName.forEach((mapped) => {
|
|
3503
|
+
const mappedHook = dir[mapped];
|
|
3504
|
+
if (mappedHook) {
|
|
3505
|
+
softAssertCompatEnabled(
|
|
3506
|
+
"CUSTOM_DIR",
|
|
3507
|
+
instance,
|
|
3508
|
+
mapped,
|
|
3509
|
+
name
|
|
3510
|
+
);
|
|
3511
|
+
hook.push(mappedHook);
|
|
3512
|
+
}
|
|
3513
|
+
});
|
|
3514
|
+
return hook.length ? hook : void 0;
|
|
3515
|
+
} else {
|
|
3516
|
+
if (dir[mappedName]) {
|
|
3517
|
+
softAssertCompatEnabled(
|
|
3518
|
+
"CUSTOM_DIR",
|
|
3519
|
+
instance,
|
|
3520
|
+
mappedName,
|
|
3521
|
+
name
|
|
3522
|
+
);
|
|
3523
|
+
}
|
|
3524
|
+
return dir[mappedName];
|
|
3515
3525
|
}
|
|
3516
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
3517
|
-
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3518
3526
|
}
|
|
3519
3527
|
}
|
|
3520
3528
|
|
|
@@ -3774,6 +3782,68 @@ function traverse(value, seen) {
|
|
|
3774
3782
|
return value;
|
|
3775
3783
|
}
|
|
3776
3784
|
|
|
3785
|
+
function validateDirectiveName(name) {
|
|
3786
|
+
if (isBuiltInDirective(name)) {
|
|
3787
|
+
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3790
|
+
function withDirectives(vnode, directives) {
|
|
3791
|
+
const internalInstance = currentRenderingInstance;
|
|
3792
|
+
if (internalInstance === null) {
|
|
3793
|
+
process.env.NODE_ENV !== "production" && warn(`withDirectives can only be used inside render functions.`);
|
|
3794
|
+
return vnode;
|
|
3795
|
+
}
|
|
3796
|
+
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
3797
|
+
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
3798
|
+
for (let i = 0; i < directives.length; i++) {
|
|
3799
|
+
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
3800
|
+
if (dir) {
|
|
3801
|
+
if (isFunction(dir)) {
|
|
3802
|
+
dir = {
|
|
3803
|
+
mounted: dir,
|
|
3804
|
+
updated: dir
|
|
3805
|
+
};
|
|
3806
|
+
}
|
|
3807
|
+
if (dir.deep) {
|
|
3808
|
+
traverse(value);
|
|
3809
|
+
}
|
|
3810
|
+
bindings.push({
|
|
3811
|
+
dir,
|
|
3812
|
+
instance,
|
|
3813
|
+
value,
|
|
3814
|
+
oldValue: void 0,
|
|
3815
|
+
arg,
|
|
3816
|
+
modifiers
|
|
3817
|
+
});
|
|
3818
|
+
}
|
|
3819
|
+
}
|
|
3820
|
+
return vnode;
|
|
3821
|
+
}
|
|
3822
|
+
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3823
|
+
const bindings = vnode.dirs;
|
|
3824
|
+
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3825
|
+
for (let i = 0; i < bindings.length; i++) {
|
|
3826
|
+
const binding = bindings[i];
|
|
3827
|
+
if (oldBindings) {
|
|
3828
|
+
binding.oldValue = oldBindings[i].value;
|
|
3829
|
+
}
|
|
3830
|
+
let hook = binding.dir[name];
|
|
3831
|
+
if (!hook) {
|
|
3832
|
+
hook = mapCompatDirectiveHook(name, binding.dir, instance);
|
|
3833
|
+
}
|
|
3834
|
+
if (hook) {
|
|
3835
|
+
pauseTracking();
|
|
3836
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3837
|
+
vnode.el,
|
|
3838
|
+
binding,
|
|
3839
|
+
vnode,
|
|
3840
|
+
prevVNode
|
|
3841
|
+
]);
|
|
3842
|
+
resetTracking();
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3777
3847
|
function useTransitionState() {
|
|
3778
3848
|
const state = {
|
|
3779
3849
|
isMounted: false,
|
|
@@ -4580,106 +4650,6 @@ function getCompatListeners(instance) {
|
|
|
4580
4650
|
return listeners;
|
|
4581
4651
|
}
|
|
4582
4652
|
|
|
4583
|
-
const legacyDirectiveHookMap = {
|
|
4584
|
-
beforeMount: "bind",
|
|
4585
|
-
mounted: "inserted",
|
|
4586
|
-
updated: ["update", "componentUpdated"],
|
|
4587
|
-
unmounted: "unbind"
|
|
4588
|
-
};
|
|
4589
|
-
function mapCompatDirectiveHook(name, dir, instance) {
|
|
4590
|
-
const mappedName = legacyDirectiveHookMap[name];
|
|
4591
|
-
if (mappedName) {
|
|
4592
|
-
if (isArray(mappedName)) {
|
|
4593
|
-
const hook = [];
|
|
4594
|
-
mappedName.forEach((mapped) => {
|
|
4595
|
-
const mappedHook = dir[mapped];
|
|
4596
|
-
if (mappedHook) {
|
|
4597
|
-
softAssertCompatEnabled(
|
|
4598
|
-
"CUSTOM_DIR",
|
|
4599
|
-
instance,
|
|
4600
|
-
mapped,
|
|
4601
|
-
name
|
|
4602
|
-
);
|
|
4603
|
-
hook.push(mappedHook);
|
|
4604
|
-
}
|
|
4605
|
-
});
|
|
4606
|
-
return hook.length ? hook : void 0;
|
|
4607
|
-
} else {
|
|
4608
|
-
if (dir[mappedName]) {
|
|
4609
|
-
softAssertCompatEnabled(
|
|
4610
|
-
"CUSTOM_DIR",
|
|
4611
|
-
instance,
|
|
4612
|
-
mappedName,
|
|
4613
|
-
name
|
|
4614
|
-
);
|
|
4615
|
-
}
|
|
4616
|
-
return dir[mappedName];
|
|
4617
|
-
}
|
|
4618
|
-
}
|
|
4619
|
-
}
|
|
4620
|
-
|
|
4621
|
-
function validateDirectiveName(name) {
|
|
4622
|
-
if (isBuiltInDirective(name)) {
|
|
4623
|
-
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
4624
|
-
}
|
|
4625
|
-
}
|
|
4626
|
-
function withDirectives(vnode, directives) {
|
|
4627
|
-
const internalInstance = currentRenderingInstance;
|
|
4628
|
-
if (internalInstance === null) {
|
|
4629
|
-
process.env.NODE_ENV !== "production" && warn(`withDirectives can only be used inside render functions.`);
|
|
4630
|
-
return vnode;
|
|
4631
|
-
}
|
|
4632
|
-
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
4633
|
-
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
4634
|
-
for (let i = 0; i < directives.length; i++) {
|
|
4635
|
-
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
4636
|
-
if (dir) {
|
|
4637
|
-
if (isFunction(dir)) {
|
|
4638
|
-
dir = {
|
|
4639
|
-
mounted: dir,
|
|
4640
|
-
updated: dir
|
|
4641
|
-
};
|
|
4642
|
-
}
|
|
4643
|
-
if (dir.deep) {
|
|
4644
|
-
traverse(value);
|
|
4645
|
-
}
|
|
4646
|
-
bindings.push({
|
|
4647
|
-
dir,
|
|
4648
|
-
instance,
|
|
4649
|
-
value,
|
|
4650
|
-
oldValue: void 0,
|
|
4651
|
-
arg,
|
|
4652
|
-
modifiers
|
|
4653
|
-
});
|
|
4654
|
-
}
|
|
4655
|
-
}
|
|
4656
|
-
return vnode;
|
|
4657
|
-
}
|
|
4658
|
-
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
4659
|
-
const bindings = vnode.dirs;
|
|
4660
|
-
const oldBindings = prevVNode && prevVNode.dirs;
|
|
4661
|
-
for (let i = 0; i < bindings.length; i++) {
|
|
4662
|
-
const binding = bindings[i];
|
|
4663
|
-
if (oldBindings) {
|
|
4664
|
-
binding.oldValue = oldBindings[i].value;
|
|
4665
|
-
}
|
|
4666
|
-
let hook = binding.dir[name];
|
|
4667
|
-
if (!hook) {
|
|
4668
|
-
hook = mapCompatDirectiveHook(name, binding.dir, instance);
|
|
4669
|
-
}
|
|
4670
|
-
if (hook) {
|
|
4671
|
-
pauseTracking();
|
|
4672
|
-
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
4673
|
-
vnode.el,
|
|
4674
|
-
binding,
|
|
4675
|
-
vnode,
|
|
4676
|
-
prevVNode
|
|
4677
|
-
]);
|
|
4678
|
-
resetTracking();
|
|
4679
|
-
}
|
|
4680
|
-
}
|
|
4681
|
-
}
|
|
4682
|
-
|
|
4683
4653
|
const COMPONENTS = "components";
|
|
4684
4654
|
const DIRECTIVES = "directives";
|
|
4685
4655
|
const FILTERS = "filters";
|
|
@@ -6022,1182 +5992,1221 @@ function mergeWatchOptions(to, from) {
|
|
|
6022
5992
|
return merged;
|
|
6023
5993
|
}
|
|
6024
5994
|
|
|
6025
|
-
function
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
} else if (key in injections) {
|
|
6044
|
-
return inject(key);
|
|
6045
|
-
}
|
|
5995
|
+
function installLegacyConfigWarnings(config) {
|
|
5996
|
+
const legacyConfigOptions = {
|
|
5997
|
+
silent: "CONFIG_SILENT",
|
|
5998
|
+
devtools: "CONFIG_DEVTOOLS",
|
|
5999
|
+
ignoredElements: "CONFIG_IGNORED_ELEMENTS",
|
|
6000
|
+
keyCodes: "CONFIG_KEY_CODES",
|
|
6001
|
+
productionTip: "CONFIG_PRODUCTION_TIP"
|
|
6002
|
+
};
|
|
6003
|
+
Object.keys(legacyConfigOptions).forEach((key) => {
|
|
6004
|
+
let val = config[key];
|
|
6005
|
+
Object.defineProperty(config, key, {
|
|
6006
|
+
enumerable: true,
|
|
6007
|
+
get() {
|
|
6008
|
+
return val;
|
|
6009
|
+
},
|
|
6010
|
+
set(newVal) {
|
|
6011
|
+
if (!isCopyingConfig) {
|
|
6012
|
+
warnDeprecation(legacyConfigOptions[key], null);
|
|
6046
6013
|
}
|
|
6014
|
+
val = newVal;
|
|
6047
6015
|
}
|
|
6048
|
-
}
|
|
6049
|
-
);
|
|
6016
|
+
});
|
|
6017
|
+
});
|
|
6050
6018
|
}
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
}
|
|
6065
|
-
return false;
|
|
6019
|
+
function installLegacyOptionMergeStrats(config) {
|
|
6020
|
+
config.optionMergeStrategies = new Proxy({}, {
|
|
6021
|
+
get(target, key) {
|
|
6022
|
+
if (key in target) {
|
|
6023
|
+
return target[key];
|
|
6024
|
+
}
|
|
6025
|
+
if (key in internalOptionMergeStrats && softAssertCompatEnabled(
|
|
6026
|
+
"CONFIG_OPTION_MERGE_STRATS",
|
|
6027
|
+
null
|
|
6028
|
+
)) {
|
|
6029
|
+
return internalOptionMergeStrats[key];
|
|
6030
|
+
}
|
|
6031
|
+
}
|
|
6032
|
+
});
|
|
6066
6033
|
}
|
|
6067
6034
|
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6035
|
+
let isCopyingConfig = false;
|
|
6036
|
+
let singletonApp;
|
|
6037
|
+
let singletonCtor;
|
|
6038
|
+
function createCompatVue$1(createApp, createSingletonApp) {
|
|
6039
|
+
singletonApp = createSingletonApp({});
|
|
6040
|
+
const Vue = singletonCtor = function Vue2(options = {}) {
|
|
6041
|
+
return createCompatApp(options, Vue2);
|
|
6042
|
+
};
|
|
6043
|
+
function createCompatApp(options = {}, Ctor) {
|
|
6044
|
+
assertCompatEnabled("GLOBAL_MOUNT", null);
|
|
6045
|
+
const { data } = options;
|
|
6046
|
+
if (data && !isFunction(data) && softAssertCompatEnabled("OPTIONS_DATA_FN", null)) {
|
|
6047
|
+
options.data = () => data;
|
|
6077
6048
|
}
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
if (!instance.type.props) {
|
|
6086
|
-
instance.props = attrs;
|
|
6049
|
+
const app = createApp(options);
|
|
6050
|
+
if (Ctor !== Vue) {
|
|
6051
|
+
applySingletonPrototype(app, Ctor);
|
|
6052
|
+
}
|
|
6053
|
+
const vm = app._createRoot(options);
|
|
6054
|
+
if (options.el) {
|
|
6055
|
+
return vm.$mount(options.el);
|
|
6087
6056
|
} else {
|
|
6088
|
-
|
|
6057
|
+
return vm;
|
|
6089
6058
|
}
|
|
6090
6059
|
}
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
}
|
|
6099
|
-
}
|
|
6100
|
-
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
6101
|
-
const {
|
|
6102
|
-
props,
|
|
6103
|
-
attrs,
|
|
6104
|
-
vnode: { patchFlag }
|
|
6105
|
-
} = instance;
|
|
6106
|
-
const rawCurrentProps = toRaw(props);
|
|
6107
|
-
const [options] = instance.propsOptions;
|
|
6108
|
-
let hasAttrsChanged = false;
|
|
6109
|
-
if (
|
|
6110
|
-
// always force full diff in dev
|
|
6111
|
-
// - #1942 if hmr is enabled with sfc component
|
|
6112
|
-
// - vite#872 non-sfc component used by sfc component
|
|
6113
|
-
!(process.env.NODE_ENV !== "production" && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
6114
|
-
) {
|
|
6115
|
-
if (patchFlag & 8) {
|
|
6116
|
-
const propsToUpdate = instance.vnode.dynamicProps;
|
|
6117
|
-
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
6118
|
-
let key = propsToUpdate[i];
|
|
6119
|
-
if (isEmitListener(instance.emitsOptions, key)) {
|
|
6120
|
-
continue;
|
|
6121
|
-
}
|
|
6122
|
-
const value = rawProps[key];
|
|
6123
|
-
if (options) {
|
|
6124
|
-
if (hasOwn(attrs, key)) {
|
|
6125
|
-
if (value !== attrs[key]) {
|
|
6126
|
-
attrs[key] = value;
|
|
6127
|
-
hasAttrsChanged = true;
|
|
6128
|
-
}
|
|
6129
|
-
} else {
|
|
6130
|
-
const camelizedKey = camelize(key);
|
|
6131
|
-
props[camelizedKey] = resolvePropValue(
|
|
6132
|
-
options,
|
|
6133
|
-
rawCurrentProps,
|
|
6134
|
-
camelizedKey,
|
|
6135
|
-
value,
|
|
6136
|
-
instance,
|
|
6137
|
-
false
|
|
6138
|
-
/* isAbsent */
|
|
6139
|
-
);
|
|
6140
|
-
}
|
|
6141
|
-
} else {
|
|
6142
|
-
{
|
|
6143
|
-
if (isOn(key) && key.endsWith("Native")) {
|
|
6144
|
-
key = key.slice(0, -6);
|
|
6145
|
-
} else if (shouldSkipAttr(key, instance)) {
|
|
6146
|
-
continue;
|
|
6147
|
-
}
|
|
6148
|
-
}
|
|
6149
|
-
if (value !== attrs[key]) {
|
|
6150
|
-
attrs[key] = value;
|
|
6151
|
-
hasAttrsChanged = true;
|
|
6152
|
-
}
|
|
6153
|
-
}
|
|
6154
|
-
}
|
|
6060
|
+
Vue.version = `2.6.14-compat:${"3.3.0-alpha.9"}`;
|
|
6061
|
+
Vue.config = singletonApp.config;
|
|
6062
|
+
Vue.use = (p, ...options) => {
|
|
6063
|
+
if (p && isFunction(p.install)) {
|
|
6064
|
+
p.install(Vue, ...options);
|
|
6065
|
+
} else if (isFunction(p)) {
|
|
6066
|
+
p(Vue, ...options);
|
|
6155
6067
|
}
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6068
|
+
return Vue;
|
|
6069
|
+
};
|
|
6070
|
+
Vue.mixin = (m) => {
|
|
6071
|
+
singletonApp.mixin(m);
|
|
6072
|
+
return Vue;
|
|
6073
|
+
};
|
|
6074
|
+
Vue.component = (name, comp) => {
|
|
6075
|
+
if (comp) {
|
|
6076
|
+
singletonApp.component(name, comp);
|
|
6077
|
+
return Vue;
|
|
6078
|
+
} else {
|
|
6079
|
+
return singletonApp.component(name);
|
|
6159
6080
|
}
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
if (rawPrevProps && // for camelCase
|
|
6168
|
-
(rawPrevProps[key] !== void 0 || // for kebab-case
|
|
6169
|
-
rawPrevProps[kebabKey] !== void 0)) {
|
|
6170
|
-
props[key] = resolvePropValue(
|
|
6171
|
-
options,
|
|
6172
|
-
rawCurrentProps,
|
|
6173
|
-
key,
|
|
6174
|
-
void 0,
|
|
6175
|
-
instance,
|
|
6176
|
-
true
|
|
6177
|
-
/* isAbsent */
|
|
6178
|
-
);
|
|
6179
|
-
}
|
|
6180
|
-
} else {
|
|
6181
|
-
delete props[key];
|
|
6182
|
-
}
|
|
6183
|
-
}
|
|
6081
|
+
};
|
|
6082
|
+
Vue.directive = (name, dir) => {
|
|
6083
|
+
if (dir) {
|
|
6084
|
+
singletonApp.directive(name, dir);
|
|
6085
|
+
return Vue;
|
|
6086
|
+
} else {
|
|
6087
|
+
return singletonApp.directive(name);
|
|
6184
6088
|
}
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6089
|
+
};
|
|
6090
|
+
Vue.options = { _base: Vue };
|
|
6091
|
+
let cid = 1;
|
|
6092
|
+
Vue.cid = cid;
|
|
6093
|
+
Vue.nextTick = nextTick;
|
|
6094
|
+
const extendCache = /* @__PURE__ */ new WeakMap();
|
|
6095
|
+
function extendCtor(extendOptions = {}) {
|
|
6096
|
+
assertCompatEnabled("GLOBAL_EXTEND", null);
|
|
6097
|
+
if (isFunction(extendOptions)) {
|
|
6098
|
+
extendOptions = extendOptions.options;
|
|
6099
|
+
}
|
|
6100
|
+
if (extendCache.has(extendOptions)) {
|
|
6101
|
+
return extendCache.get(extendOptions);
|
|
6102
|
+
}
|
|
6103
|
+
const Super = this;
|
|
6104
|
+
function SubVue(inlineOptions) {
|
|
6105
|
+
if (!inlineOptions) {
|
|
6106
|
+
return createCompatApp(SubVue.options, SubVue);
|
|
6107
|
+
} else {
|
|
6108
|
+
return createCompatApp(
|
|
6109
|
+
mergeOptions(
|
|
6110
|
+
extend({}, SubVue.options),
|
|
6111
|
+
inlineOptions,
|
|
6112
|
+
internalOptionMergeStrats
|
|
6113
|
+
),
|
|
6114
|
+
SubVue
|
|
6115
|
+
);
|
|
6191
6116
|
}
|
|
6192
6117
|
}
|
|
6118
|
+
SubVue.super = Super;
|
|
6119
|
+
SubVue.prototype = Object.create(Vue.prototype);
|
|
6120
|
+
SubVue.prototype.constructor = SubVue;
|
|
6121
|
+
const mergeBase = {};
|
|
6122
|
+
for (const key in Super.options) {
|
|
6123
|
+
const superValue = Super.options[key];
|
|
6124
|
+
mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
|
|
6125
|
+
}
|
|
6126
|
+
SubVue.options = mergeOptions(
|
|
6127
|
+
mergeBase,
|
|
6128
|
+
extendOptions,
|
|
6129
|
+
internalOptionMergeStrats
|
|
6130
|
+
);
|
|
6131
|
+
SubVue.options._base = SubVue;
|
|
6132
|
+
SubVue.extend = extendCtor.bind(SubVue);
|
|
6133
|
+
SubVue.mixin = Super.mixin;
|
|
6134
|
+
SubVue.use = Super.use;
|
|
6135
|
+
SubVue.cid = ++cid;
|
|
6136
|
+
extendCache.set(extendOptions, SubVue);
|
|
6137
|
+
return SubVue;
|
|
6193
6138
|
}
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
"INSTANCE_EVENT_HOOKS",
|
|
6214
|
-
instance,
|
|
6215
|
-
key.slice(2).toLowerCase()
|
|
6216
|
-
);
|
|
6217
|
-
}
|
|
6218
|
-
if (key === "inline-template") {
|
|
6219
|
-
continue;
|
|
6220
|
-
}
|
|
6221
|
-
}
|
|
6222
|
-
const value = rawProps[key];
|
|
6223
|
-
let camelKey;
|
|
6224
|
-
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
6225
|
-
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
6226
|
-
props[camelKey] = value;
|
|
6227
|
-
} else {
|
|
6228
|
-
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
6229
|
-
}
|
|
6230
|
-
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
6231
|
-
{
|
|
6232
|
-
if (isOn(key) && key.endsWith("Native")) {
|
|
6233
|
-
key = key.slice(0, -6);
|
|
6234
|
-
} else if (shouldSkipAttr(key, instance)) {
|
|
6235
|
-
continue;
|
|
6236
|
-
}
|
|
6237
|
-
}
|
|
6238
|
-
if (!(key in attrs) || value !== attrs[key]) {
|
|
6239
|
-
attrs[key] = value;
|
|
6240
|
-
hasAttrsChanged = true;
|
|
6241
|
-
}
|
|
6242
|
-
}
|
|
6139
|
+
Vue.extend = extendCtor.bind(Vue);
|
|
6140
|
+
Vue.set = (target, key, value) => {
|
|
6141
|
+
assertCompatEnabled("GLOBAL_SET", null);
|
|
6142
|
+
target[key] = value;
|
|
6143
|
+
};
|
|
6144
|
+
Vue.delete = (target, key) => {
|
|
6145
|
+
assertCompatEnabled("GLOBAL_DELETE", null);
|
|
6146
|
+
delete target[key];
|
|
6147
|
+
};
|
|
6148
|
+
Vue.observable = (target) => {
|
|
6149
|
+
assertCompatEnabled("GLOBAL_OBSERVABLE", null);
|
|
6150
|
+
return reactive(target);
|
|
6151
|
+
};
|
|
6152
|
+
Vue.filter = (name, filter) => {
|
|
6153
|
+
if (filter) {
|
|
6154
|
+
singletonApp.filter(name, filter);
|
|
6155
|
+
return Vue;
|
|
6156
|
+
} else {
|
|
6157
|
+
return singletonApp.filter(name);
|
|
6243
6158
|
}
|
|
6244
|
-
}
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
);
|
|
6159
|
+
};
|
|
6160
|
+
const util = {
|
|
6161
|
+
warn: process.env.NODE_ENV !== "production" ? warn : NOOP,
|
|
6162
|
+
extend,
|
|
6163
|
+
mergeOptions: (parent, child, vm) => mergeOptions(
|
|
6164
|
+
parent,
|
|
6165
|
+
child,
|
|
6166
|
+
vm ? void 0 : internalOptionMergeStrats
|
|
6167
|
+
),
|
|
6168
|
+
defineReactive
|
|
6169
|
+
};
|
|
6170
|
+
Object.defineProperty(Vue, "util", {
|
|
6171
|
+
get() {
|
|
6172
|
+
assertCompatEnabled("GLOBAL_PRIVATE_UTIL", null);
|
|
6173
|
+
return util;
|
|
6258
6174
|
}
|
|
6175
|
+
});
|
|
6176
|
+
Vue.configureCompat = configureCompat$1;
|
|
6177
|
+
return Vue;
|
|
6178
|
+
}
|
|
6179
|
+
function installAppCompatProperties(app, context, render) {
|
|
6180
|
+
installFilterMethod(app, context);
|
|
6181
|
+
installLegacyOptionMergeStrats(app.config);
|
|
6182
|
+
if (!singletonApp) {
|
|
6183
|
+
return;
|
|
6259
6184
|
}
|
|
6260
|
-
|
|
6185
|
+
installCompatMount(app, context, render);
|
|
6186
|
+
installLegacyAPIs(app);
|
|
6187
|
+
applySingletonAppMutations(app);
|
|
6188
|
+
if (process.env.NODE_ENV !== "production")
|
|
6189
|
+
installLegacyConfigWarnings(app.config);
|
|
6261
6190
|
}
|
|
6262
|
-
function
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
if (
|
|
6267
|
-
|
|
6268
|
-
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
|
|
6269
|
-
const { propsDefaults } = instance;
|
|
6270
|
-
if (key in propsDefaults) {
|
|
6271
|
-
value = propsDefaults[key];
|
|
6272
|
-
} else {
|
|
6273
|
-
setCurrentInstance(instance);
|
|
6274
|
-
value = propsDefaults[key] = defaultValue.call(
|
|
6275
|
-
isCompatEnabled("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
|
|
6276
|
-
props
|
|
6277
|
-
);
|
|
6278
|
-
unsetCurrentInstance();
|
|
6279
|
-
}
|
|
6280
|
-
} else {
|
|
6281
|
-
value = defaultValue;
|
|
6282
|
-
}
|
|
6191
|
+
function installFilterMethod(app, context) {
|
|
6192
|
+
context.filters = {};
|
|
6193
|
+
app.filter = (name, filter) => {
|
|
6194
|
+
assertCompatEnabled("FILTERS", null);
|
|
6195
|
+
if (!filter) {
|
|
6196
|
+
return context.filters[name];
|
|
6283
6197
|
}
|
|
6284
|
-
if (
|
|
6285
|
-
|
|
6286
|
-
value = false;
|
|
6287
|
-
} else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
|
|
6288
|
-
value = true;
|
|
6289
|
-
}
|
|
6198
|
+
if (process.env.NODE_ENV !== "production" && context.filters[name]) {
|
|
6199
|
+
warn(`Filter "${name}" has already been registered.`);
|
|
6290
6200
|
}
|
|
6291
|
-
|
|
6292
|
-
|
|
6201
|
+
context.filters[name] = filter;
|
|
6202
|
+
return app;
|
|
6203
|
+
};
|
|
6293
6204
|
}
|
|
6294
|
-
function
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6205
|
+
function installLegacyAPIs(app) {
|
|
6206
|
+
Object.defineProperties(app, {
|
|
6207
|
+
// so that app.use() can work with legacy plugins that extend prototypes
|
|
6208
|
+
prototype: {
|
|
6209
|
+
get() {
|
|
6210
|
+
process.env.NODE_ENV !== "production" && warnDeprecation("GLOBAL_PROTOTYPE", null);
|
|
6211
|
+
return app.config.globalProperties;
|
|
6212
|
+
}
|
|
6213
|
+
},
|
|
6214
|
+
nextTick: { value: nextTick },
|
|
6215
|
+
extend: { value: singletonCtor.extend },
|
|
6216
|
+
set: { value: singletonCtor.set },
|
|
6217
|
+
delete: { value: singletonCtor.delete },
|
|
6218
|
+
observable: { value: singletonCtor.observable },
|
|
6219
|
+
util: {
|
|
6220
|
+
get() {
|
|
6221
|
+
return singletonCtor.util;
|
|
6308
6222
|
}
|
|
6309
|
-
hasExtends = true;
|
|
6310
|
-
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
6311
|
-
extend(normalized, props);
|
|
6312
|
-
if (keys)
|
|
6313
|
-
needCastKeys.push(...keys);
|
|
6314
|
-
};
|
|
6315
|
-
if (!asMixin && appContext.mixins.length) {
|
|
6316
|
-
appContext.mixins.forEach(extendProps);
|
|
6317
6223
|
}
|
|
6318
|
-
|
|
6319
|
-
|
|
6224
|
+
});
|
|
6225
|
+
}
|
|
6226
|
+
function applySingletonAppMutations(app) {
|
|
6227
|
+
app._context.mixins = [...singletonApp._context.mixins];
|
|
6228
|
+
["components", "directives", "filters"].forEach((key) => {
|
|
6229
|
+
app._context[key] = Object.create(singletonApp._context[key]);
|
|
6230
|
+
});
|
|
6231
|
+
isCopyingConfig = true;
|
|
6232
|
+
for (const key in singletonApp.config) {
|
|
6233
|
+
if (key === "isNativeTag")
|
|
6234
|
+
continue;
|
|
6235
|
+
if (isRuntimeOnly() && (key === "isCustomElement" || key === "compilerOptions")) {
|
|
6236
|
+
continue;
|
|
6320
6237
|
}
|
|
6321
|
-
|
|
6322
|
-
|
|
6238
|
+
const val = singletonApp.config[key];
|
|
6239
|
+
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
6240
|
+
if (key === "ignoredElements" && isCompatEnabled("CONFIG_IGNORED_ELEMENTS", null) && !isRuntimeOnly() && isArray(val)) {
|
|
6241
|
+
app.config.compilerOptions.isCustomElement = (tag) => {
|
|
6242
|
+
return val.some((v) => isString(v) ? v === tag : v.test(tag));
|
|
6243
|
+
};
|
|
6323
6244
|
}
|
|
6324
6245
|
}
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6246
|
+
isCopyingConfig = false;
|
|
6247
|
+
applySingletonPrototype(app, singletonCtor);
|
|
6248
|
+
}
|
|
6249
|
+
function applySingletonPrototype(app, Ctor) {
|
|
6250
|
+
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE", null);
|
|
6251
|
+
if (enabled) {
|
|
6252
|
+
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
6330
6253
|
}
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
if (process.env.NODE_ENV !== "production" && !isObject(raw)) {
|
|
6343
|
-
warn(`invalid props options`, raw);
|
|
6344
|
-
}
|
|
6345
|
-
for (const key in raw) {
|
|
6346
|
-
const normalizedKey = camelize(key);
|
|
6347
|
-
if (validatePropName(normalizedKey)) {
|
|
6348
|
-
const opt = raw[key];
|
|
6349
|
-
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
|
|
6350
|
-
if (prop) {
|
|
6351
|
-
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
6352
|
-
const stringIndex = getTypeIndex(String, prop.type);
|
|
6353
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
6354
|
-
prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
|
|
6355
|
-
if (booleanIndex > -1 || hasOwn(prop, "default")) {
|
|
6356
|
-
needCastKeys.push(normalizedKey);
|
|
6357
|
-
}
|
|
6358
|
-
}
|
|
6254
|
+
let hasPrototypeAugmentations = false;
|
|
6255
|
+
const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
|
|
6256
|
+
for (const key in descriptors) {
|
|
6257
|
+
if (key !== "constructor") {
|
|
6258
|
+
hasPrototypeAugmentations = true;
|
|
6259
|
+
if (enabled) {
|
|
6260
|
+
Object.defineProperty(
|
|
6261
|
+
app.config.globalProperties,
|
|
6262
|
+
key,
|
|
6263
|
+
descriptors[key]
|
|
6264
|
+
);
|
|
6359
6265
|
}
|
|
6360
6266
|
}
|
|
6361
6267
|
}
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
cache.set(comp, res);
|
|
6365
|
-
}
|
|
6366
|
-
return res;
|
|
6367
|
-
}
|
|
6368
|
-
function validatePropName(key) {
|
|
6369
|
-
if (key[0] !== "$") {
|
|
6370
|
-
return true;
|
|
6371
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
6372
|
-
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
6373
|
-
}
|
|
6374
|
-
return false;
|
|
6375
|
-
}
|
|
6376
|
-
function getType(ctor) {
|
|
6377
|
-
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
6378
|
-
return match ? match[2] : ctor === null ? "null" : "";
|
|
6379
|
-
}
|
|
6380
|
-
function isSameType(a, b) {
|
|
6381
|
-
return getType(a) === getType(b);
|
|
6382
|
-
}
|
|
6383
|
-
function getTypeIndex(type, expectedTypes) {
|
|
6384
|
-
if (isArray(expectedTypes)) {
|
|
6385
|
-
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
6386
|
-
} else if (isFunction(expectedTypes)) {
|
|
6387
|
-
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
6388
|
-
}
|
|
6389
|
-
return -1;
|
|
6390
|
-
}
|
|
6391
|
-
function validateProps(rawProps, props, instance) {
|
|
6392
|
-
const resolvedValues = toRaw(props);
|
|
6393
|
-
const options = instance.propsOptions[0];
|
|
6394
|
-
for (const key in options) {
|
|
6395
|
-
let opt = options[key];
|
|
6396
|
-
if (opt == null)
|
|
6397
|
-
continue;
|
|
6398
|
-
validateProp(
|
|
6399
|
-
key,
|
|
6400
|
-
resolvedValues[key],
|
|
6401
|
-
opt,
|
|
6402
|
-
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
6403
|
-
);
|
|
6268
|
+
if (process.env.NODE_ENV !== "production" && hasPrototypeAugmentations) {
|
|
6269
|
+
warnDeprecation("GLOBAL_PROTOTYPE", null);
|
|
6404
6270
|
}
|
|
6405
6271
|
}
|
|
6406
|
-
function
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
const expectedTypes = [];
|
|
6419
|
-
for (let i = 0; i < types.length && !isValid; i++) {
|
|
6420
|
-
const { valid, expectedType } = assertType(value, types[i]);
|
|
6421
|
-
expectedTypes.push(expectedType || "");
|
|
6422
|
-
isValid = valid;
|
|
6272
|
+
function installCompatMount(app, context, render) {
|
|
6273
|
+
let isMounted = false;
|
|
6274
|
+
app._createRoot = (options) => {
|
|
6275
|
+
const component = app._component;
|
|
6276
|
+
const vnode = createVNode(component, options.propsData || null);
|
|
6277
|
+
vnode.appContext = context;
|
|
6278
|
+
const hasNoRender = !isFunction(component) && !component.render && !component.template;
|
|
6279
|
+
const emptyRender = () => {
|
|
6280
|
+
};
|
|
6281
|
+
const instance = createComponentInstance(vnode, null, null);
|
|
6282
|
+
if (hasNoRender) {
|
|
6283
|
+
instance.render = emptyRender;
|
|
6423
6284
|
}
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6285
|
+
setupComponent(instance);
|
|
6286
|
+
vnode.component = instance;
|
|
6287
|
+
vnode.isCompatRoot = true;
|
|
6288
|
+
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
6289
|
+
if (isMounted) {
|
|
6290
|
+
process.env.NODE_ENV !== "production" && warn(`Root instance is already mounted.`);
|
|
6291
|
+
return;
|
|
6292
|
+
}
|
|
6293
|
+
let container;
|
|
6294
|
+
if (typeof selectorOrEl === "string") {
|
|
6295
|
+
const result = document.querySelector(selectorOrEl);
|
|
6296
|
+
if (!result) {
|
|
6297
|
+
process.env.NODE_ENV !== "production" && warn(
|
|
6298
|
+
`Failed to mount root instance: selector "${selectorOrEl}" returned null.`
|
|
6299
|
+
);
|
|
6300
|
+
return;
|
|
6301
|
+
}
|
|
6302
|
+
container = result;
|
|
6303
|
+
} else {
|
|
6304
|
+
container = selectorOrEl || document.createElement("div");
|
|
6305
|
+
}
|
|
6306
|
+
const isSVG = container instanceof SVGElement;
|
|
6307
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6308
|
+
context.reload = () => {
|
|
6309
|
+
const cloned = cloneVNode(vnode);
|
|
6310
|
+
cloned.component = null;
|
|
6311
|
+
render(cloned, container, isSVG);
|
|
6312
|
+
};
|
|
6313
|
+
}
|
|
6314
|
+
if (hasNoRender && instance.render === emptyRender) {
|
|
6315
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6316
|
+
for (let i = 0; i < container.attributes.length; i++) {
|
|
6317
|
+
const attr = container.attributes[i];
|
|
6318
|
+
if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
|
|
6319
|
+
warnDeprecation("GLOBAL_MOUNT_CONTAINER", null);
|
|
6320
|
+
break;
|
|
6321
|
+
}
|
|
6322
|
+
}
|
|
6323
|
+
}
|
|
6324
|
+
instance.render = null;
|
|
6325
|
+
component.template = container.innerHTML;
|
|
6326
|
+
finishComponentSetup(
|
|
6327
|
+
instance,
|
|
6328
|
+
false,
|
|
6329
|
+
true
|
|
6330
|
+
/* skip options */
|
|
6331
|
+
);
|
|
6332
|
+
}
|
|
6333
|
+
container.innerHTML = "";
|
|
6334
|
+
render(vnode, container, isSVG);
|
|
6335
|
+
if (container instanceof Element) {
|
|
6336
|
+
container.removeAttribute("v-cloak");
|
|
6337
|
+
container.setAttribute("data-v-app", "");
|
|
6338
|
+
}
|
|
6339
|
+
isMounted = true;
|
|
6340
|
+
app._container = container;
|
|
6341
|
+
container.__vue_app__ = app;
|
|
6342
|
+
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
6343
|
+
devtoolsInitApp(app, version);
|
|
6344
|
+
}
|
|
6345
|
+
return instance.proxy;
|
|
6346
|
+
};
|
|
6347
|
+
instance.ctx._compat_destroy = () => {
|
|
6348
|
+
if (isMounted) {
|
|
6349
|
+
render(null, app._container);
|
|
6350
|
+
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
6351
|
+
devtoolsUnmountApp(app);
|
|
6352
|
+
}
|
|
6353
|
+
delete app._container.__vue_app__;
|
|
6354
|
+
} else {
|
|
6355
|
+
const { bum, scope, um } = instance;
|
|
6356
|
+
if (bum) {
|
|
6357
|
+
invokeArrayFns(bum);
|
|
6358
|
+
}
|
|
6359
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
|
|
6360
|
+
instance.emit("hook:beforeDestroy");
|
|
6361
|
+
}
|
|
6362
|
+
if (scope) {
|
|
6363
|
+
scope.stop();
|
|
6364
|
+
}
|
|
6365
|
+
if (um) {
|
|
6366
|
+
invokeArrayFns(um);
|
|
6367
|
+
}
|
|
6368
|
+
if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
|
|
6369
|
+
instance.emit("hook:destroyed");
|
|
6370
|
+
}
|
|
6371
|
+
}
|
|
6372
|
+
};
|
|
6373
|
+
return instance.proxy;
|
|
6374
|
+
};
|
|
6375
|
+
}
|
|
6376
|
+
const methodsToPatch = [
|
|
6377
|
+
"push",
|
|
6378
|
+
"pop",
|
|
6379
|
+
"shift",
|
|
6380
|
+
"unshift",
|
|
6381
|
+
"splice",
|
|
6382
|
+
"sort",
|
|
6383
|
+
"reverse"
|
|
6384
|
+
];
|
|
6385
|
+
const patched = /* @__PURE__ */ new WeakSet();
|
|
6386
|
+
function defineReactive(obj, key, val) {
|
|
6387
|
+
if (isObject(val) && !isReactive(val) && !patched.has(val)) {
|
|
6388
|
+
const reactiveVal = reactive(val);
|
|
6389
|
+
if (isArray(val)) {
|
|
6390
|
+
methodsToPatch.forEach((m) => {
|
|
6391
|
+
val[m] = (...args) => {
|
|
6392
|
+
Array.prototype[m].call(reactiveVal, ...args);
|
|
6393
|
+
};
|
|
6394
|
+
});
|
|
6395
|
+
} else {
|
|
6396
|
+
Object.keys(val).forEach((key2) => {
|
|
6397
|
+
try {
|
|
6398
|
+
defineReactiveSimple(val, key2, val[key2]);
|
|
6399
|
+
} catch (e) {
|
|
6400
|
+
}
|
|
6401
|
+
});
|
|
6427
6402
|
}
|
|
6428
6403
|
}
|
|
6429
|
-
|
|
6430
|
-
|
|
6404
|
+
const i = obj.$;
|
|
6405
|
+
if (i && obj === i.proxy) {
|
|
6406
|
+
defineReactiveSimple(i.ctx, key, val);
|
|
6407
|
+
i.accessCache = /* @__PURE__ */ Object.create(null);
|
|
6408
|
+
} else if (isReactive(obj)) {
|
|
6409
|
+
obj[key] = val;
|
|
6410
|
+
} else {
|
|
6411
|
+
defineReactiveSimple(obj, key, val);
|
|
6431
6412
|
}
|
|
6432
6413
|
}
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6414
|
+
function defineReactiveSimple(obj, key, val) {
|
|
6415
|
+
val = isObject(val) ? reactive(val) : val;
|
|
6416
|
+
Object.defineProperty(obj, key, {
|
|
6417
|
+
enumerable: true,
|
|
6418
|
+
configurable: true,
|
|
6419
|
+
get() {
|
|
6420
|
+
track(obj, "get", key);
|
|
6421
|
+
return val;
|
|
6422
|
+
},
|
|
6423
|
+
set(newVal) {
|
|
6424
|
+
val = isObject(newVal) ? reactive(newVal) : newVal;
|
|
6425
|
+
trigger(obj, "set", key, newVal);
|
|
6444
6426
|
}
|
|
6445
|
-
}
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
} else if (expectedType === "null") {
|
|
6450
|
-
valid = value === null;
|
|
6451
|
-
} else {
|
|
6452
|
-
valid = value instanceof type;
|
|
6453
|
-
}
|
|
6427
|
+
});
|
|
6428
|
+
}
|
|
6429
|
+
|
|
6430
|
+
function createAppContext() {
|
|
6454
6431
|
return {
|
|
6455
|
-
|
|
6456
|
-
|
|
6432
|
+
app: null,
|
|
6433
|
+
config: {
|
|
6434
|
+
isNativeTag: NO,
|
|
6435
|
+
performance: false,
|
|
6436
|
+
globalProperties: {},
|
|
6437
|
+
optionMergeStrategies: {},
|
|
6438
|
+
errorHandler: void 0,
|
|
6439
|
+
warnHandler: void 0,
|
|
6440
|
+
compilerOptions: {}
|
|
6441
|
+
},
|
|
6442
|
+
mixins: [],
|
|
6443
|
+
components: {},
|
|
6444
|
+
directives: {},
|
|
6445
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
6446
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
6447
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
6448
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
6457
6449
|
};
|
|
6458
6450
|
}
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
const receivedValue = styleValue(value, receivedType);
|
|
6465
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
|
|
6466
|
-
message += ` with value ${expectedValue}`;
|
|
6467
|
-
}
|
|
6468
|
-
message += `, got ${receivedType} `;
|
|
6469
|
-
if (isExplicable(receivedType)) {
|
|
6470
|
-
message += `with value ${receivedValue}.`;
|
|
6471
|
-
}
|
|
6472
|
-
return message;
|
|
6473
|
-
}
|
|
6474
|
-
function styleValue(value, type) {
|
|
6475
|
-
if (type === "String") {
|
|
6476
|
-
return `"${value}"`;
|
|
6477
|
-
} else if (type === "Number") {
|
|
6478
|
-
return `${Number(value)}`;
|
|
6479
|
-
} else {
|
|
6480
|
-
return `${value}`;
|
|
6481
|
-
}
|
|
6482
|
-
}
|
|
6483
|
-
function isExplicable(type) {
|
|
6484
|
-
const explicitTypes = ["string", "number", "boolean"];
|
|
6485
|
-
return explicitTypes.some((elem) => type.toLowerCase() === elem);
|
|
6486
|
-
}
|
|
6487
|
-
function isBoolean(...args) {
|
|
6488
|
-
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
6489
|
-
}
|
|
6490
|
-
|
|
6491
|
-
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
6492
|
-
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
6493
|
-
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
6494
|
-
if (rawSlot._n) {
|
|
6495
|
-
return rawSlot;
|
|
6496
|
-
}
|
|
6497
|
-
const normalized = withCtx((...args) => {
|
|
6498
|
-
if (process.env.NODE_ENV !== "production" && currentInstance) {
|
|
6499
|
-
warn(
|
|
6500
|
-
`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
|
|
6501
|
-
);
|
|
6502
|
-
}
|
|
6503
|
-
return normalizeSlotValue(rawSlot(...args));
|
|
6504
|
-
}, ctx);
|
|
6505
|
-
normalized._c = false;
|
|
6506
|
-
return normalized;
|
|
6507
|
-
};
|
|
6508
|
-
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
6509
|
-
const ctx = rawSlots._ctx;
|
|
6510
|
-
for (const key in rawSlots) {
|
|
6511
|
-
if (isInternalKey(key))
|
|
6512
|
-
continue;
|
|
6513
|
-
const value = rawSlots[key];
|
|
6514
|
-
if (isFunction(value)) {
|
|
6515
|
-
slots[key] = normalizeSlot(key, value, ctx);
|
|
6516
|
-
} else if (value != null) {
|
|
6517
|
-
if (process.env.NODE_ENV !== "production" && !isCompatEnabled("RENDER_FUNCTION", instance)) {
|
|
6518
|
-
warn(
|
|
6519
|
-
`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
|
|
6520
|
-
);
|
|
6521
|
-
}
|
|
6522
|
-
const normalized = normalizeSlotValue(value);
|
|
6523
|
-
slots[key] = () => normalized;
|
|
6524
|
-
}
|
|
6525
|
-
}
|
|
6526
|
-
};
|
|
6527
|
-
const normalizeVNodeSlots = (instance, children) => {
|
|
6528
|
-
if (process.env.NODE_ENV !== "production" && !isKeepAlive(instance.vnode) && !isCompatEnabled("RENDER_FUNCTION", instance)) {
|
|
6529
|
-
warn(
|
|
6530
|
-
`Non-function value encountered for default slot. Prefer function slots for better performance.`
|
|
6531
|
-
);
|
|
6532
|
-
}
|
|
6533
|
-
const normalized = normalizeSlotValue(children);
|
|
6534
|
-
instance.slots.default = () => normalized;
|
|
6535
|
-
};
|
|
6536
|
-
const initSlots = (instance, children) => {
|
|
6537
|
-
if (instance.vnode.shapeFlag & 32) {
|
|
6538
|
-
const type = children._;
|
|
6539
|
-
if (type) {
|
|
6540
|
-
instance.slots = toRaw(children);
|
|
6541
|
-
def(children, "_", type);
|
|
6542
|
-
} else {
|
|
6543
|
-
normalizeObjectSlots(
|
|
6544
|
-
children,
|
|
6545
|
-
instance.slots = {},
|
|
6546
|
-
instance
|
|
6547
|
-
);
|
|
6451
|
+
let uid$1 = 0;
|
|
6452
|
+
function createAppAPI(render, hydrate) {
|
|
6453
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
6454
|
+
if (!isFunction(rootComponent)) {
|
|
6455
|
+
rootComponent = extend({}, rootComponent);
|
|
6548
6456
|
}
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
normalizeVNodeSlots(instance, children);
|
|
6457
|
+
if (rootProps != null && !isObject(rootProps)) {
|
|
6458
|
+
process.env.NODE_ENV !== "production" && warn(`root props passed to app.mount() must be an object.`);
|
|
6459
|
+
rootProps = null;
|
|
6553
6460
|
}
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
const
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6461
|
+
const context = createAppContext();
|
|
6462
|
+
const installedPlugins = /* @__PURE__ */ new Set();
|
|
6463
|
+
let isMounted = false;
|
|
6464
|
+
const app = context.app = {
|
|
6465
|
+
_uid: uid$1++,
|
|
6466
|
+
_component: rootComponent,
|
|
6467
|
+
_props: rootProps,
|
|
6468
|
+
_container: null,
|
|
6469
|
+
_context: context,
|
|
6470
|
+
_instance: null,
|
|
6471
|
+
version,
|
|
6472
|
+
get config() {
|
|
6473
|
+
return context.config;
|
|
6474
|
+
},
|
|
6475
|
+
set config(v) {
|
|
6476
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6477
|
+
warn(
|
|
6478
|
+
`app.config cannot be replaced. Modify individual options instead.`
|
|
6479
|
+
);
|
|
6572
6480
|
}
|
|
6573
|
-
}
|
|
6574
|
-
} else {
|
|
6575
|
-
needDeletionCheck = !children.$stable;
|
|
6576
|
-
normalizeObjectSlots(children, slots, instance);
|
|
6577
|
-
}
|
|
6578
|
-
deletionComparisonTarget = children;
|
|
6579
|
-
} else if (children) {
|
|
6580
|
-
normalizeVNodeSlots(instance, children);
|
|
6581
|
-
deletionComparisonTarget = { default: 1 };
|
|
6582
|
-
}
|
|
6583
|
-
if (needDeletionCheck) {
|
|
6584
|
-
for (const key in slots) {
|
|
6585
|
-
if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
|
|
6586
|
-
delete slots[key];
|
|
6587
|
-
}
|
|
6588
|
-
}
|
|
6589
|
-
}
|
|
6590
|
-
};
|
|
6591
|
-
|
|
6592
|
-
function installLegacyConfigWarnings(config) {
|
|
6593
|
-
const legacyConfigOptions = {
|
|
6594
|
-
silent: "CONFIG_SILENT",
|
|
6595
|
-
devtools: "CONFIG_DEVTOOLS",
|
|
6596
|
-
ignoredElements: "CONFIG_IGNORED_ELEMENTS",
|
|
6597
|
-
keyCodes: "CONFIG_KEY_CODES",
|
|
6598
|
-
productionTip: "CONFIG_PRODUCTION_TIP"
|
|
6599
|
-
};
|
|
6600
|
-
Object.keys(legacyConfigOptions).forEach((key) => {
|
|
6601
|
-
let val = config[key];
|
|
6602
|
-
Object.defineProperty(config, key, {
|
|
6603
|
-
enumerable: true,
|
|
6604
|
-
get() {
|
|
6605
|
-
return val;
|
|
6606
6481
|
},
|
|
6607
|
-
|
|
6608
|
-
if (
|
|
6609
|
-
|
|
6482
|
+
use(plugin, ...options) {
|
|
6483
|
+
if (installedPlugins.has(plugin)) {
|
|
6484
|
+
process.env.NODE_ENV !== "production" && warn(`Plugin has already been applied to target app.`);
|
|
6485
|
+
} else if (plugin && isFunction(plugin.install)) {
|
|
6486
|
+
installedPlugins.add(plugin);
|
|
6487
|
+
plugin.install(app, ...options);
|
|
6488
|
+
} else if (isFunction(plugin)) {
|
|
6489
|
+
installedPlugins.add(plugin);
|
|
6490
|
+
plugin(app, ...options);
|
|
6491
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6492
|
+
warn(
|
|
6493
|
+
`A plugin must either be a function or an object with an "install" function.`
|
|
6494
|
+
);
|
|
6495
|
+
}
|
|
6496
|
+
return app;
|
|
6497
|
+
},
|
|
6498
|
+
mixin(mixin) {
|
|
6499
|
+
if (__VUE_OPTIONS_API__) {
|
|
6500
|
+
if (!context.mixins.includes(mixin)) {
|
|
6501
|
+
context.mixins.push(mixin);
|
|
6502
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6503
|
+
warn(
|
|
6504
|
+
"Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
|
|
6505
|
+
);
|
|
6506
|
+
}
|
|
6507
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6508
|
+
warn("Mixins are only available in builds supporting Options API");
|
|
6509
|
+
}
|
|
6510
|
+
return app;
|
|
6511
|
+
},
|
|
6512
|
+
component(name, component) {
|
|
6513
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6514
|
+
validateComponentName(name, context.config);
|
|
6515
|
+
}
|
|
6516
|
+
if (!component) {
|
|
6517
|
+
return context.components[name];
|
|
6518
|
+
}
|
|
6519
|
+
if (process.env.NODE_ENV !== "production" && context.components[name]) {
|
|
6520
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
6521
|
+
}
|
|
6522
|
+
context.components[name] = component;
|
|
6523
|
+
return app;
|
|
6524
|
+
},
|
|
6525
|
+
directive(name, directive) {
|
|
6526
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6527
|
+
validateDirectiveName(name);
|
|
6528
|
+
}
|
|
6529
|
+
if (!directive) {
|
|
6530
|
+
return context.directives[name];
|
|
6531
|
+
}
|
|
6532
|
+
if (process.env.NODE_ENV !== "production" && context.directives[name]) {
|
|
6533
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
6534
|
+
}
|
|
6535
|
+
context.directives[name] = directive;
|
|
6536
|
+
return app;
|
|
6537
|
+
},
|
|
6538
|
+
mount(rootContainer, isHydrate, isSVG) {
|
|
6539
|
+
if (!isMounted) {
|
|
6540
|
+
if (process.env.NODE_ENV !== "production" && rootContainer.__vue_app__) {
|
|
6541
|
+
warn(
|
|
6542
|
+
`There is already an app instance mounted on the host container.
|
|
6543
|
+
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
6544
|
+
);
|
|
6545
|
+
}
|
|
6546
|
+
const vnode = createVNode(
|
|
6547
|
+
rootComponent,
|
|
6548
|
+
rootProps
|
|
6549
|
+
);
|
|
6550
|
+
vnode.appContext = context;
|
|
6551
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6552
|
+
context.reload = () => {
|
|
6553
|
+
render(cloneVNode(vnode), rootContainer, isSVG);
|
|
6554
|
+
};
|
|
6555
|
+
}
|
|
6556
|
+
if (isHydrate && hydrate) {
|
|
6557
|
+
hydrate(vnode, rootContainer);
|
|
6558
|
+
} else {
|
|
6559
|
+
render(vnode, rootContainer, isSVG);
|
|
6560
|
+
}
|
|
6561
|
+
isMounted = true;
|
|
6562
|
+
app._container = rootContainer;
|
|
6563
|
+
rootContainer.__vue_app__ = app;
|
|
6564
|
+
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
6565
|
+
app._instance = vnode.component;
|
|
6566
|
+
devtoolsInitApp(app, version);
|
|
6567
|
+
}
|
|
6568
|
+
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
6569
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6570
|
+
warn(
|
|
6571
|
+
`App has already been mounted.
|
|
6572
|
+
If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
|
|
6573
|
+
);
|
|
6574
|
+
}
|
|
6575
|
+
},
|
|
6576
|
+
unmount() {
|
|
6577
|
+
if (isMounted) {
|
|
6578
|
+
render(null, app._container);
|
|
6579
|
+
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
6580
|
+
app._instance = null;
|
|
6581
|
+
devtoolsUnmountApp(app);
|
|
6582
|
+
}
|
|
6583
|
+
delete app._container.__vue_app__;
|
|
6584
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6585
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
6586
|
+
}
|
|
6587
|
+
},
|
|
6588
|
+
provide(key, value) {
|
|
6589
|
+
if (process.env.NODE_ENV !== "production" && key in context.provides) {
|
|
6590
|
+
warn(
|
|
6591
|
+
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
6592
|
+
);
|
|
6593
|
+
}
|
|
6594
|
+
context.provides[key] = value;
|
|
6595
|
+
return app;
|
|
6596
|
+
},
|
|
6597
|
+
runWithContext(fn) {
|
|
6598
|
+
currentApp = app;
|
|
6599
|
+
try {
|
|
6600
|
+
return fn();
|
|
6601
|
+
} finally {
|
|
6602
|
+
currentApp = null;
|
|
6610
6603
|
}
|
|
6611
|
-
val = newVal;
|
|
6612
|
-
}
|
|
6613
|
-
});
|
|
6614
|
-
});
|
|
6615
|
-
}
|
|
6616
|
-
function installLegacyOptionMergeStrats(config) {
|
|
6617
|
-
config.optionMergeStrategies = new Proxy({}, {
|
|
6618
|
-
get(target, key) {
|
|
6619
|
-
if (key in target) {
|
|
6620
|
-
return target[key];
|
|
6621
|
-
}
|
|
6622
|
-
if (key in internalOptionMergeStrats && softAssertCompatEnabled(
|
|
6623
|
-
"CONFIG_OPTION_MERGE_STRATS",
|
|
6624
|
-
null
|
|
6625
|
-
)) {
|
|
6626
|
-
return internalOptionMergeStrats[key];
|
|
6627
|
-
}
|
|
6628
|
-
}
|
|
6629
|
-
});
|
|
6630
|
-
}
|
|
6631
|
-
|
|
6632
|
-
let isCopyingConfig = false;
|
|
6633
|
-
let singletonApp;
|
|
6634
|
-
let singletonCtor;
|
|
6635
|
-
function createCompatVue$1(createApp, createSingletonApp) {
|
|
6636
|
-
singletonApp = createSingletonApp({});
|
|
6637
|
-
const Vue = singletonCtor = function Vue2(options = {}) {
|
|
6638
|
-
return createCompatApp(options, Vue2);
|
|
6639
|
-
};
|
|
6640
|
-
function createCompatApp(options = {}, Ctor) {
|
|
6641
|
-
assertCompatEnabled("GLOBAL_MOUNT", null);
|
|
6642
|
-
const { data } = options;
|
|
6643
|
-
if (data && !isFunction(data) && softAssertCompatEnabled("OPTIONS_DATA_FN", null)) {
|
|
6644
|
-
options.data = () => data;
|
|
6645
|
-
}
|
|
6646
|
-
const app = createApp(options);
|
|
6647
|
-
if (Ctor !== Vue) {
|
|
6648
|
-
applySingletonPrototype(app, Ctor);
|
|
6649
|
-
}
|
|
6650
|
-
const vm = app._createRoot(options);
|
|
6651
|
-
if (options.el) {
|
|
6652
|
-
return vm.$mount(options.el);
|
|
6653
|
-
} else {
|
|
6654
|
-
return vm;
|
|
6655
|
-
}
|
|
6656
|
-
}
|
|
6657
|
-
Vue.version = `2.6.14-compat:${"3.3.0-alpha.7"}`;
|
|
6658
|
-
Vue.config = singletonApp.config;
|
|
6659
|
-
Vue.use = (p, ...options) => {
|
|
6660
|
-
if (p && isFunction(p.install)) {
|
|
6661
|
-
p.install(Vue, ...options);
|
|
6662
|
-
} else if (isFunction(p)) {
|
|
6663
|
-
p(Vue, ...options);
|
|
6664
|
-
}
|
|
6665
|
-
return Vue;
|
|
6666
|
-
};
|
|
6667
|
-
Vue.mixin = (m) => {
|
|
6668
|
-
singletonApp.mixin(m);
|
|
6669
|
-
return Vue;
|
|
6670
|
-
};
|
|
6671
|
-
Vue.component = (name, comp) => {
|
|
6672
|
-
if (comp) {
|
|
6673
|
-
singletonApp.component(name, comp);
|
|
6674
|
-
return Vue;
|
|
6675
|
-
} else {
|
|
6676
|
-
return singletonApp.component(name);
|
|
6677
|
-
}
|
|
6678
|
-
};
|
|
6679
|
-
Vue.directive = (name, dir) => {
|
|
6680
|
-
if (dir) {
|
|
6681
|
-
singletonApp.directive(name, dir);
|
|
6682
|
-
return Vue;
|
|
6683
|
-
} else {
|
|
6684
|
-
return singletonApp.directive(name);
|
|
6685
|
-
}
|
|
6686
|
-
};
|
|
6687
|
-
Vue.options = { _base: Vue };
|
|
6688
|
-
let cid = 1;
|
|
6689
|
-
Vue.cid = cid;
|
|
6690
|
-
Vue.nextTick = nextTick;
|
|
6691
|
-
const extendCache = /* @__PURE__ */ new WeakMap();
|
|
6692
|
-
function extendCtor(extendOptions = {}) {
|
|
6693
|
-
assertCompatEnabled("GLOBAL_EXTEND", null);
|
|
6694
|
-
if (isFunction(extendOptions)) {
|
|
6695
|
-
extendOptions = extendOptions.options;
|
|
6696
|
-
}
|
|
6697
|
-
if (extendCache.has(extendOptions)) {
|
|
6698
|
-
return extendCache.get(extendOptions);
|
|
6699
|
-
}
|
|
6700
|
-
const Super = this;
|
|
6701
|
-
function SubVue(inlineOptions) {
|
|
6702
|
-
if (!inlineOptions) {
|
|
6703
|
-
return createCompatApp(SubVue.options, SubVue);
|
|
6704
|
-
} else {
|
|
6705
|
-
return createCompatApp(
|
|
6706
|
-
mergeOptions(
|
|
6707
|
-
extend({}, SubVue.options),
|
|
6708
|
-
inlineOptions,
|
|
6709
|
-
internalOptionMergeStrats
|
|
6710
|
-
),
|
|
6711
|
-
SubVue
|
|
6712
|
-
);
|
|
6713
6604
|
}
|
|
6605
|
+
};
|
|
6606
|
+
{
|
|
6607
|
+
installAppCompatProperties(app, context, render);
|
|
6714
6608
|
}
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6609
|
+
return app;
|
|
6610
|
+
};
|
|
6611
|
+
}
|
|
6612
|
+
let currentApp = null;
|
|
6613
|
+
|
|
6614
|
+
function provide(key, value) {
|
|
6615
|
+
if (!currentInstance) {
|
|
6616
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6617
|
+
warn(`provide() can only be used inside setup().`);
|
|
6722
6618
|
}
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
SubVue.mixin = Super.mixin;
|
|
6731
|
-
SubVue.use = Super.use;
|
|
6732
|
-
SubVue.cid = ++cid;
|
|
6733
|
-
extendCache.set(extendOptions, SubVue);
|
|
6734
|
-
return SubVue;
|
|
6619
|
+
} else {
|
|
6620
|
+
let provides = currentInstance.provides;
|
|
6621
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
6622
|
+
if (parentProvides === provides) {
|
|
6623
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
6624
|
+
}
|
|
6625
|
+
provides[key] = value;
|
|
6735
6626
|
}
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
return reactive(target);
|
|
6748
|
-
};
|
|
6749
|
-
Vue.filter = (name, filter) => {
|
|
6750
|
-
if (filter) {
|
|
6751
|
-
singletonApp.filter(name, filter);
|
|
6752
|
-
return Vue;
|
|
6753
|
-
} else {
|
|
6754
|
-
return singletonApp.filter(name);
|
|
6627
|
+
}
|
|
6628
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
6629
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
6630
|
+
if (instance || currentApp) {
|
|
6631
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
|
|
6632
|
+
if (provides && key in provides) {
|
|
6633
|
+
return provides[key];
|
|
6634
|
+
} else if (arguments.length > 1) {
|
|
6635
|
+
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
6636
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6637
|
+
warn(`injection "${String(key)}" not found.`);
|
|
6755
6638
|
}
|
|
6756
|
-
}
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6639
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6640
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
6641
|
+
}
|
|
6642
|
+
}
|
|
6643
|
+
|
|
6644
|
+
function createPropsDefaultThis(instance, rawProps, propKey) {
|
|
6645
|
+
return new Proxy(
|
|
6646
|
+
{},
|
|
6647
|
+
{
|
|
6648
|
+
get(_, key) {
|
|
6649
|
+
process.env.NODE_ENV !== "production" && warnDeprecation("PROPS_DEFAULT_THIS", null, propKey);
|
|
6650
|
+
if (key === "$options") {
|
|
6651
|
+
return resolveMergedOptions(instance);
|
|
6652
|
+
}
|
|
6653
|
+
if (key in rawProps) {
|
|
6654
|
+
return rawProps[key];
|
|
6655
|
+
}
|
|
6656
|
+
const injections = instance.type.inject;
|
|
6657
|
+
if (injections) {
|
|
6658
|
+
if (isArray(injections)) {
|
|
6659
|
+
if (injections.includes(key)) {
|
|
6660
|
+
return inject(key);
|
|
6661
|
+
}
|
|
6662
|
+
} else if (key in injections) {
|
|
6663
|
+
return inject(key);
|
|
6664
|
+
}
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6771
6667
|
}
|
|
6772
|
-
|
|
6773
|
-
Vue.configureCompat = configureCompat$1;
|
|
6774
|
-
return Vue;
|
|
6668
|
+
);
|
|
6775
6669
|
}
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
return;
|
|
6670
|
+
|
|
6671
|
+
function shouldSkipAttr(key, instance) {
|
|
6672
|
+
if (key === "is") {
|
|
6673
|
+
return true;
|
|
6781
6674
|
}
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
if (
|
|
6786
|
-
|
|
6675
|
+
if ((key === "class" || key === "style") && isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE", instance)) {
|
|
6676
|
+
return true;
|
|
6677
|
+
}
|
|
6678
|
+
if (isOn(key) && isCompatEnabled("INSTANCE_LISTENERS", instance)) {
|
|
6679
|
+
return true;
|
|
6680
|
+
}
|
|
6681
|
+
if (key.startsWith("routerView") || key === "registerRouteInstance") {
|
|
6682
|
+
return true;
|
|
6683
|
+
}
|
|
6684
|
+
return false;
|
|
6787
6685
|
}
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6686
|
+
|
|
6687
|
+
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
6688
|
+
const props = {};
|
|
6689
|
+
const attrs = {};
|
|
6690
|
+
def(attrs, InternalObjectKey, 1);
|
|
6691
|
+
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
6692
|
+
setFullProps(instance, rawProps, props, attrs);
|
|
6693
|
+
for (const key in instance.propsOptions[0]) {
|
|
6694
|
+
if (!(key in props)) {
|
|
6695
|
+
props[key] = void 0;
|
|
6794
6696
|
}
|
|
6795
|
-
|
|
6796
|
-
|
|
6697
|
+
}
|
|
6698
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6699
|
+
validateProps(rawProps || {}, props, instance);
|
|
6700
|
+
}
|
|
6701
|
+
if (isStateful) {
|
|
6702
|
+
instance.props = isSSR ? props : shallowReactive(props);
|
|
6703
|
+
} else {
|
|
6704
|
+
if (!instance.type.props) {
|
|
6705
|
+
instance.props = attrs;
|
|
6706
|
+
} else {
|
|
6707
|
+
instance.props = props;
|
|
6797
6708
|
}
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
};
|
|
6709
|
+
}
|
|
6710
|
+
instance.attrs = attrs;
|
|
6801
6711
|
}
|
|
6802
|
-
function
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6712
|
+
function isInHmrContext(instance) {
|
|
6713
|
+
while (instance) {
|
|
6714
|
+
if (instance.type.__hmrId)
|
|
6715
|
+
return true;
|
|
6716
|
+
instance = instance.parent;
|
|
6717
|
+
}
|
|
6718
|
+
}
|
|
6719
|
+
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
6720
|
+
const {
|
|
6721
|
+
props,
|
|
6722
|
+
attrs,
|
|
6723
|
+
vnode: { patchFlag }
|
|
6724
|
+
} = instance;
|
|
6725
|
+
const rawCurrentProps = toRaw(props);
|
|
6726
|
+
const [options] = instance.propsOptions;
|
|
6727
|
+
let hasAttrsChanged = false;
|
|
6728
|
+
if (
|
|
6729
|
+
// always force full diff in dev
|
|
6730
|
+
// - #1942 if hmr is enabled with sfc component
|
|
6731
|
+
// - vite#872 non-sfc component used by sfc component
|
|
6732
|
+
!(process.env.NODE_ENV !== "production" && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
6733
|
+
) {
|
|
6734
|
+
if (patchFlag & 8) {
|
|
6735
|
+
const propsToUpdate = instance.vnode.dynamicProps;
|
|
6736
|
+
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
6737
|
+
let key = propsToUpdate[i];
|
|
6738
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
6739
|
+
continue;
|
|
6740
|
+
}
|
|
6741
|
+
const value = rawProps[key];
|
|
6742
|
+
if (options) {
|
|
6743
|
+
if (hasOwn(attrs, key)) {
|
|
6744
|
+
if (value !== attrs[key]) {
|
|
6745
|
+
attrs[key] = value;
|
|
6746
|
+
hasAttrsChanged = true;
|
|
6747
|
+
}
|
|
6748
|
+
} else {
|
|
6749
|
+
const camelizedKey = camelize(key);
|
|
6750
|
+
props[camelizedKey] = resolvePropValue(
|
|
6751
|
+
options,
|
|
6752
|
+
rawCurrentProps,
|
|
6753
|
+
camelizedKey,
|
|
6754
|
+
value,
|
|
6755
|
+
instance,
|
|
6756
|
+
false
|
|
6757
|
+
/* isAbsent */
|
|
6758
|
+
);
|
|
6759
|
+
}
|
|
6760
|
+
} else {
|
|
6761
|
+
{
|
|
6762
|
+
if (isOn(key) && key.endsWith("Native")) {
|
|
6763
|
+
key = key.slice(0, -6);
|
|
6764
|
+
} else if (shouldSkipAttr(key, instance)) {
|
|
6765
|
+
continue;
|
|
6766
|
+
}
|
|
6767
|
+
}
|
|
6768
|
+
if (value !== attrs[key]) {
|
|
6769
|
+
attrs[key] = value;
|
|
6770
|
+
hasAttrsChanged = true;
|
|
6771
|
+
}
|
|
6772
|
+
}
|
|
6819
6773
|
}
|
|
6820
6774
|
}
|
|
6821
|
-
}
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6775
|
+
} else {
|
|
6776
|
+
if (setFullProps(instance, rawProps, props, attrs)) {
|
|
6777
|
+
hasAttrsChanged = true;
|
|
6778
|
+
}
|
|
6779
|
+
let kebabKey;
|
|
6780
|
+
for (const key in rawCurrentProps) {
|
|
6781
|
+
if (!rawProps || // for camelCase
|
|
6782
|
+
!hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
|
|
6783
|
+
// and converted to camelCase (#955)
|
|
6784
|
+
((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
6785
|
+
if (options) {
|
|
6786
|
+
if (rawPrevProps && // for camelCase
|
|
6787
|
+
(rawPrevProps[key] !== void 0 || // for kebab-case
|
|
6788
|
+
rawPrevProps[kebabKey] !== void 0)) {
|
|
6789
|
+
props[key] = resolvePropValue(
|
|
6790
|
+
options,
|
|
6791
|
+
rawCurrentProps,
|
|
6792
|
+
key,
|
|
6793
|
+
void 0,
|
|
6794
|
+
instance,
|
|
6795
|
+
true
|
|
6796
|
+
/* isAbsent */
|
|
6797
|
+
);
|
|
6798
|
+
}
|
|
6799
|
+
} else {
|
|
6800
|
+
delete props[key];
|
|
6801
|
+
}
|
|
6802
|
+
}
|
|
6834
6803
|
}
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6804
|
+
if (attrs !== rawCurrentProps) {
|
|
6805
|
+
for (const key in attrs) {
|
|
6806
|
+
if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
|
|
6807
|
+
delete attrs[key];
|
|
6808
|
+
hasAttrsChanged = true;
|
|
6809
|
+
}
|
|
6810
|
+
}
|
|
6841
6811
|
}
|
|
6842
6812
|
}
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
}
|
|
6846
|
-
function applySingletonPrototype(app, Ctor) {
|
|
6847
|
-
const enabled = isCompatEnabled("GLOBAL_PROTOTYPE", null);
|
|
6848
|
-
if (enabled) {
|
|
6849
|
-
app.config.globalProperties = Object.create(Ctor.prototype);
|
|
6813
|
+
if (hasAttrsChanged) {
|
|
6814
|
+
trigger(instance, "set", "$attrs");
|
|
6850
6815
|
}
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6816
|
+
if (process.env.NODE_ENV !== "production") {
|
|
6817
|
+
validateProps(rawProps || {}, props, instance);
|
|
6818
|
+
}
|
|
6819
|
+
}
|
|
6820
|
+
function setFullProps(instance, rawProps, props, attrs) {
|
|
6821
|
+
const [options, needCastKeys] = instance.propsOptions;
|
|
6822
|
+
let hasAttrsChanged = false;
|
|
6823
|
+
let rawCastValues;
|
|
6824
|
+
if (rawProps) {
|
|
6825
|
+
for (let key in rawProps) {
|
|
6826
|
+
if (isReservedProp(key)) {
|
|
6827
|
+
continue;
|
|
6828
|
+
}
|
|
6829
|
+
{
|
|
6830
|
+
if (key.startsWith("onHook:")) {
|
|
6831
|
+
softAssertCompatEnabled(
|
|
6832
|
+
"INSTANCE_EVENT_HOOKS",
|
|
6833
|
+
instance,
|
|
6834
|
+
key.slice(2).toLowerCase()
|
|
6835
|
+
);
|
|
6836
|
+
}
|
|
6837
|
+
if (key === "inline-template") {
|
|
6838
|
+
continue;
|
|
6839
|
+
}
|
|
6840
|
+
}
|
|
6841
|
+
const value = rawProps[key];
|
|
6842
|
+
let camelKey;
|
|
6843
|
+
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
6844
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
6845
|
+
props[camelKey] = value;
|
|
6846
|
+
} else {
|
|
6847
|
+
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
6848
|
+
}
|
|
6849
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
6850
|
+
{
|
|
6851
|
+
if (isOn(key) && key.endsWith("Native")) {
|
|
6852
|
+
key = key.slice(0, -6);
|
|
6853
|
+
} else if (shouldSkipAttr(key, instance)) {
|
|
6854
|
+
continue;
|
|
6855
|
+
}
|
|
6856
|
+
}
|
|
6857
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
6858
|
+
attrs[key] = value;
|
|
6859
|
+
hasAttrsChanged = true;
|
|
6860
|
+
}
|
|
6862
6861
|
}
|
|
6863
6862
|
}
|
|
6864
6863
|
}
|
|
6865
|
-
if (
|
|
6866
|
-
|
|
6864
|
+
if (needCastKeys) {
|
|
6865
|
+
const rawCurrentProps = toRaw(props);
|
|
6866
|
+
const castValues = rawCastValues || EMPTY_OBJ;
|
|
6867
|
+
for (let i = 0; i < needCastKeys.length; i++) {
|
|
6868
|
+
const key = needCastKeys[i];
|
|
6869
|
+
props[key] = resolvePropValue(
|
|
6870
|
+
options,
|
|
6871
|
+
rawCurrentProps,
|
|
6872
|
+
key,
|
|
6873
|
+
castValues[key],
|
|
6874
|
+
instance,
|
|
6875
|
+
!hasOwn(castValues, key)
|
|
6876
|
+
);
|
|
6877
|
+
}
|
|
6867
6878
|
}
|
|
6879
|
+
return hasAttrsChanged;
|
|
6868
6880
|
}
|
|
6869
|
-
function
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
const
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
vnode.isCompatRoot = true;
|
|
6885
|
-
instance.ctx._compat_mount = (selectorOrEl) => {
|
|
6886
|
-
if (isMounted) {
|
|
6887
|
-
process.env.NODE_ENV !== "production" && warn(`Root instance is already mounted.`);
|
|
6888
|
-
return;
|
|
6889
|
-
}
|
|
6890
|
-
let container;
|
|
6891
|
-
if (typeof selectorOrEl === "string") {
|
|
6892
|
-
const result = document.querySelector(selectorOrEl);
|
|
6893
|
-
if (!result) {
|
|
6894
|
-
process.env.NODE_ENV !== "production" && warn(
|
|
6895
|
-
`Failed to mount root instance: selector "${selectorOrEl}" returned null.`
|
|
6881
|
+
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
6882
|
+
const opt = options[key];
|
|
6883
|
+
if (opt != null) {
|
|
6884
|
+
const hasDefault = hasOwn(opt, "default");
|
|
6885
|
+
if (hasDefault && value === void 0) {
|
|
6886
|
+
const defaultValue = opt.default;
|
|
6887
|
+
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
|
|
6888
|
+
const { propsDefaults } = instance;
|
|
6889
|
+
if (key in propsDefaults) {
|
|
6890
|
+
value = propsDefaults[key];
|
|
6891
|
+
} else {
|
|
6892
|
+
setCurrentInstance(instance);
|
|
6893
|
+
value = propsDefaults[key] = defaultValue.call(
|
|
6894
|
+
isCompatEnabled("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null,
|
|
6895
|
+
props
|
|
6896
6896
|
);
|
|
6897
|
-
|
|
6897
|
+
unsetCurrentInstance();
|
|
6898
6898
|
}
|
|
6899
|
-
container = result;
|
|
6900
6899
|
} else {
|
|
6901
|
-
|
|
6900
|
+
value = defaultValue;
|
|
6902
6901
|
}
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
};
|
|
6902
|
+
}
|
|
6903
|
+
if (opt[0 /* shouldCast */]) {
|
|
6904
|
+
if (isAbsent && !hasDefault) {
|
|
6905
|
+
value = false;
|
|
6906
|
+
} else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
|
|
6907
|
+
value = true;
|
|
6910
6908
|
}
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6909
|
+
}
|
|
6910
|
+
}
|
|
6911
|
+
return value;
|
|
6912
|
+
}
|
|
6913
|
+
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
6914
|
+
const cache = appContext.propsCache;
|
|
6915
|
+
const cached = cache.get(comp);
|
|
6916
|
+
if (cached) {
|
|
6917
|
+
return cached;
|
|
6918
|
+
}
|
|
6919
|
+
const raw = comp.props;
|
|
6920
|
+
const normalized = {};
|
|
6921
|
+
const needCastKeys = [];
|
|
6922
|
+
let hasExtends = false;
|
|
6923
|
+
if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
|
|
6924
|
+
const extendProps = (raw2) => {
|
|
6925
|
+
if (isFunction(raw2)) {
|
|
6926
|
+
raw2 = raw2.options;
|
|
6929
6927
|
}
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6928
|
+
hasExtends = true;
|
|
6929
|
+
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
6930
|
+
extend(normalized, props);
|
|
6931
|
+
if (keys)
|
|
6932
|
+
needCastKeys.push(...keys);
|
|
6933
|
+
};
|
|
6934
|
+
if (!asMixin && appContext.mixins.length) {
|
|
6935
|
+
appContext.mixins.forEach(extendProps);
|
|
6936
|
+
}
|
|
6937
|
+
if (comp.extends) {
|
|
6938
|
+
extendProps(comp.extends);
|
|
6939
|
+
}
|
|
6940
|
+
if (comp.mixins) {
|
|
6941
|
+
comp.mixins.forEach(extendProps);
|
|
6942
|
+
}
|
|
6943
|
+
}
|
|
6944
|
+
if (!raw && !hasExtends) {
|
|
6945
|
+
if (isObject(comp)) {
|
|
6946
|
+
cache.set(comp, EMPTY_ARR);
|
|
6947
|
+
}
|
|
6948
|
+
return EMPTY_ARR;
|
|
6949
|
+
}
|
|
6950
|
+
if (isArray(raw)) {
|
|
6951
|
+
for (let i = 0; i < raw.length; i++) {
|
|
6952
|
+
if (process.env.NODE_ENV !== "production" && !isString(raw[i])) {
|
|
6953
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
6935
6954
|
}
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
6940
|
-
devtoolsInitApp(app, version);
|
|
6955
|
+
const normalizedKey = camelize(raw[i]);
|
|
6956
|
+
if (validatePropName(normalizedKey)) {
|
|
6957
|
+
normalized[normalizedKey] = EMPTY_OBJ;
|
|
6941
6958
|
}
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
scope.stop();
|
|
6961
|
-
}
|
|
6962
|
-
if (um) {
|
|
6963
|
-
invokeArrayFns(um);
|
|
6964
|
-
}
|
|
6965
|
-
if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
|
|
6966
|
-
instance.emit("hook:destroyed");
|
|
6959
|
+
}
|
|
6960
|
+
} else if (raw) {
|
|
6961
|
+
if (process.env.NODE_ENV !== "production" && !isObject(raw)) {
|
|
6962
|
+
warn(`invalid props options`, raw);
|
|
6963
|
+
}
|
|
6964
|
+
for (const key in raw) {
|
|
6965
|
+
const normalizedKey = camelize(key);
|
|
6966
|
+
if (validatePropName(normalizedKey)) {
|
|
6967
|
+
const opt = raw[key];
|
|
6968
|
+
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
|
|
6969
|
+
if (prop) {
|
|
6970
|
+
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
6971
|
+
const stringIndex = getTypeIndex(String, prop.type);
|
|
6972
|
+
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
6973
|
+
prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
|
|
6974
|
+
if (booleanIndex > -1 || hasOwn(prop, "default")) {
|
|
6975
|
+
needCastKeys.push(normalizedKey);
|
|
6976
|
+
}
|
|
6967
6977
|
}
|
|
6968
6978
|
}
|
|
6969
|
-
};
|
|
6970
|
-
return instance.proxy;
|
|
6971
|
-
};
|
|
6972
|
-
}
|
|
6973
|
-
const methodsToPatch = [
|
|
6974
|
-
"push",
|
|
6975
|
-
"pop",
|
|
6976
|
-
"shift",
|
|
6977
|
-
"unshift",
|
|
6978
|
-
"splice",
|
|
6979
|
-
"sort",
|
|
6980
|
-
"reverse"
|
|
6981
|
-
];
|
|
6982
|
-
const patched = /* @__PURE__ */ new WeakSet();
|
|
6983
|
-
function defineReactive(obj, key, val) {
|
|
6984
|
-
if (isObject(val) && !isReactive(val) && !patched.has(val)) {
|
|
6985
|
-
const reactiveVal = reactive(val);
|
|
6986
|
-
if (isArray(val)) {
|
|
6987
|
-
methodsToPatch.forEach((m) => {
|
|
6988
|
-
val[m] = (...args) => {
|
|
6989
|
-
Array.prototype[m].call(reactiveVal, ...args);
|
|
6990
|
-
};
|
|
6991
|
-
});
|
|
6992
|
-
} else {
|
|
6993
|
-
Object.keys(val).forEach((key2) => {
|
|
6994
|
-
try {
|
|
6995
|
-
defineReactiveSimple(val, key2, val[key2]);
|
|
6996
|
-
} catch (e) {
|
|
6997
|
-
}
|
|
6998
|
-
});
|
|
6999
6979
|
}
|
|
7000
6980
|
}
|
|
7001
|
-
const
|
|
7002
|
-
if (
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
6981
|
+
const res = [normalized, needCastKeys];
|
|
6982
|
+
if (isObject(comp)) {
|
|
6983
|
+
cache.set(comp, res);
|
|
6984
|
+
}
|
|
6985
|
+
return res;
|
|
6986
|
+
}
|
|
6987
|
+
function validatePropName(key) {
|
|
6988
|
+
if (key[0] !== "$") {
|
|
6989
|
+
return true;
|
|
6990
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
6991
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
7009
6992
|
}
|
|
6993
|
+
return false;
|
|
7010
6994
|
}
|
|
7011
|
-
function
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
6995
|
+
function getType(ctor) {
|
|
6996
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
6997
|
+
return match ? match[2] : ctor === null ? "null" : "";
|
|
6998
|
+
}
|
|
6999
|
+
function isSameType(a, b) {
|
|
7000
|
+
return getType(a) === getType(b);
|
|
7001
|
+
}
|
|
7002
|
+
function getTypeIndex(type, expectedTypes) {
|
|
7003
|
+
if (isArray(expectedTypes)) {
|
|
7004
|
+
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
7005
|
+
} else if (isFunction(expectedTypes)) {
|
|
7006
|
+
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
7007
|
+
}
|
|
7008
|
+
return -1;
|
|
7009
|
+
}
|
|
7010
|
+
function validateProps(rawProps, props, instance) {
|
|
7011
|
+
const resolvedValues = toRaw(props);
|
|
7012
|
+
const options = instance.propsOptions[0];
|
|
7013
|
+
for (const key in options) {
|
|
7014
|
+
let opt = options[key];
|
|
7015
|
+
if (opt == null)
|
|
7016
|
+
continue;
|
|
7017
|
+
validateProp(
|
|
7018
|
+
key,
|
|
7019
|
+
resolvedValues[key],
|
|
7020
|
+
opt,
|
|
7021
|
+
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
7022
|
+
);
|
|
7023
|
+
}
|
|
7024
|
+
}
|
|
7025
|
+
function validateProp(name, value, prop, isAbsent) {
|
|
7026
|
+
const { type, required, validator, skipCheck } = prop;
|
|
7027
|
+
if (required && isAbsent) {
|
|
7028
|
+
warn('Missing required prop: "' + name + '"');
|
|
7029
|
+
return;
|
|
7030
|
+
}
|
|
7031
|
+
if (value == null && !required) {
|
|
7032
|
+
return;
|
|
7033
|
+
}
|
|
7034
|
+
if (type != null && type !== true && !skipCheck) {
|
|
7035
|
+
let isValid = false;
|
|
7036
|
+
const types = isArray(type) ? type : [type];
|
|
7037
|
+
const expectedTypes = [];
|
|
7038
|
+
for (let i = 0; i < types.length && !isValid; i++) {
|
|
7039
|
+
const { valid, expectedType } = assertType(value, types[i]);
|
|
7040
|
+
expectedTypes.push(expectedType || "");
|
|
7041
|
+
isValid = valid;
|
|
7023
7042
|
}
|
|
7024
|
-
|
|
7043
|
+
if (!isValid) {
|
|
7044
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
7045
|
+
return;
|
|
7046
|
+
}
|
|
7047
|
+
}
|
|
7048
|
+
if (validator && !validator(value)) {
|
|
7049
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
7050
|
+
}
|
|
7025
7051
|
}
|
|
7026
|
-
|
|
7027
|
-
|
|
7052
|
+
const isSimpleType = /* @__PURE__ */ makeMap(
|
|
7053
|
+
"String,Number,Boolean,Function,Symbol,BigInt"
|
|
7054
|
+
);
|
|
7055
|
+
function assertType(value, type) {
|
|
7056
|
+
let valid;
|
|
7057
|
+
const expectedType = getType(type);
|
|
7058
|
+
if (isSimpleType(expectedType)) {
|
|
7059
|
+
const t = typeof value;
|
|
7060
|
+
valid = t === expectedType.toLowerCase();
|
|
7061
|
+
if (!valid && t === "object") {
|
|
7062
|
+
valid = value instanceof type;
|
|
7063
|
+
}
|
|
7064
|
+
} else if (expectedType === "Object") {
|
|
7065
|
+
valid = isObject(value);
|
|
7066
|
+
} else if (expectedType === "Array") {
|
|
7067
|
+
valid = isArray(value);
|
|
7068
|
+
} else if (expectedType === "null") {
|
|
7069
|
+
valid = value === null;
|
|
7070
|
+
} else {
|
|
7071
|
+
valid = value instanceof type;
|
|
7072
|
+
}
|
|
7028
7073
|
return {
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
isNativeTag: NO,
|
|
7032
|
-
performance: false,
|
|
7033
|
-
globalProperties: {},
|
|
7034
|
-
optionMergeStrategies: {},
|
|
7035
|
-
errorHandler: void 0,
|
|
7036
|
-
warnHandler: void 0,
|
|
7037
|
-
compilerOptions: {}
|
|
7038
|
-
},
|
|
7039
|
-
mixins: [],
|
|
7040
|
-
components: {},
|
|
7041
|
-
directives: {},
|
|
7042
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
7043
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
7044
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
7045
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
7074
|
+
valid,
|
|
7075
|
+
expectedType
|
|
7046
7076
|
};
|
|
7047
7077
|
}
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7078
|
+
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
7079
|
+
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
|
|
7080
|
+
const expectedType = expectedTypes[0];
|
|
7081
|
+
const receivedType = toRawType(value);
|
|
7082
|
+
const expectedValue = styleValue(value, expectedType);
|
|
7083
|
+
const receivedValue = styleValue(value, receivedType);
|
|
7084
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
|
|
7085
|
+
message += ` with value ${expectedValue}`;
|
|
7086
|
+
}
|
|
7087
|
+
message += `, got ${receivedType} `;
|
|
7088
|
+
if (isExplicable(receivedType)) {
|
|
7089
|
+
message += `with value ${receivedValue}.`;
|
|
7090
|
+
}
|
|
7091
|
+
return message;
|
|
7092
|
+
}
|
|
7093
|
+
function styleValue(value, type) {
|
|
7094
|
+
if (type === "String") {
|
|
7095
|
+
return `"${value}"`;
|
|
7096
|
+
} else if (type === "Number") {
|
|
7097
|
+
return `${Number(value)}`;
|
|
7098
|
+
} else {
|
|
7099
|
+
return `${value}`;
|
|
7100
|
+
}
|
|
7101
|
+
}
|
|
7102
|
+
function isExplicable(type) {
|
|
7103
|
+
const explicitTypes = ["string", "number", "boolean"];
|
|
7104
|
+
return explicitTypes.some((elem) => type.toLowerCase() === elem);
|
|
7105
|
+
}
|
|
7106
|
+
function isBoolean(...args) {
|
|
7107
|
+
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
7108
|
+
}
|
|
7109
|
+
|
|
7110
|
+
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
7111
|
+
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
7112
|
+
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
7113
|
+
if (rawSlot._n) {
|
|
7114
|
+
return rawSlot;
|
|
7115
|
+
}
|
|
7116
|
+
const normalized = withCtx((...args) => {
|
|
7117
|
+
if (process.env.NODE_ENV !== "production" && currentInstance) {
|
|
7118
|
+
warn(
|
|
7119
|
+
`Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
|
|
7120
|
+
);
|
|
7053
7121
|
}
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7122
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
7123
|
+
}, ctx);
|
|
7124
|
+
normalized._c = false;
|
|
7125
|
+
return normalized;
|
|
7126
|
+
};
|
|
7127
|
+
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
7128
|
+
const ctx = rawSlots._ctx;
|
|
7129
|
+
for (const key in rawSlots) {
|
|
7130
|
+
if (isInternalKey(key))
|
|
7131
|
+
continue;
|
|
7132
|
+
const value = rawSlots[key];
|
|
7133
|
+
if (isFunction(value)) {
|
|
7134
|
+
slots[key] = normalizeSlot(key, value, ctx);
|
|
7135
|
+
} else if (value != null) {
|
|
7136
|
+
if (process.env.NODE_ENV !== "production" && !isCompatEnabled("RENDER_FUNCTION", instance)) {
|
|
7137
|
+
warn(
|
|
7138
|
+
`Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
|
|
7139
|
+
);
|
|
7140
|
+
}
|
|
7141
|
+
const normalized = normalizeSlotValue(value);
|
|
7142
|
+
slots[key] = () => normalized;
|
|
7057
7143
|
}
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
warn("Mixins are only available in builds supporting Options API");
|
|
7106
|
-
}
|
|
7107
|
-
return app;
|
|
7108
|
-
},
|
|
7109
|
-
component(name, component) {
|
|
7110
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7111
|
-
validateComponentName(name, context.config);
|
|
7112
|
-
}
|
|
7113
|
-
if (!component) {
|
|
7114
|
-
return context.components[name];
|
|
7115
|
-
}
|
|
7116
|
-
if (process.env.NODE_ENV !== "production" && context.components[name]) {
|
|
7117
|
-
warn(`Component "${name}" has already been registered in target app.`);
|
|
7118
|
-
}
|
|
7119
|
-
context.components[name] = component;
|
|
7120
|
-
return app;
|
|
7121
|
-
},
|
|
7122
|
-
directive(name, directive) {
|
|
7123
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7124
|
-
validateDirectiveName(name);
|
|
7125
|
-
}
|
|
7126
|
-
if (!directive) {
|
|
7127
|
-
return context.directives[name];
|
|
7128
|
-
}
|
|
7129
|
-
if (process.env.NODE_ENV !== "production" && context.directives[name]) {
|
|
7130
|
-
warn(`Directive "${name}" has already been registered in target app.`);
|
|
7131
|
-
}
|
|
7132
|
-
context.directives[name] = directive;
|
|
7133
|
-
return app;
|
|
7134
|
-
},
|
|
7135
|
-
mount(rootContainer, isHydrate, isSVG) {
|
|
7136
|
-
if (!isMounted) {
|
|
7137
|
-
if (process.env.NODE_ENV !== "production" && rootContainer.__vue_app__) {
|
|
7138
|
-
warn(
|
|
7139
|
-
`There is already an app instance mounted on the host container.
|
|
7140
|
-
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
7141
|
-
);
|
|
7142
|
-
}
|
|
7143
|
-
const vnode = createVNode(
|
|
7144
|
-
rootComponent,
|
|
7145
|
-
rootProps
|
|
7146
|
-
);
|
|
7147
|
-
vnode.appContext = context;
|
|
7148
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7149
|
-
context.reload = () => {
|
|
7150
|
-
render(cloneVNode(vnode), rootContainer, isSVG);
|
|
7151
|
-
};
|
|
7152
|
-
}
|
|
7153
|
-
if (isHydrate && hydrate) {
|
|
7154
|
-
hydrate(vnode, rootContainer);
|
|
7155
|
-
} else {
|
|
7156
|
-
render(vnode, rootContainer, isSVG);
|
|
7157
|
-
}
|
|
7158
|
-
isMounted = true;
|
|
7159
|
-
app._container = rootContainer;
|
|
7160
|
-
rootContainer.__vue_app__ = app;
|
|
7161
|
-
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
7162
|
-
app._instance = vnode.component;
|
|
7163
|
-
devtoolsInitApp(app, version);
|
|
7164
|
-
}
|
|
7165
|
-
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
7166
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
7167
|
-
warn(
|
|
7168
|
-
`App has already been mounted.
|
|
7169
|
-
If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
|
|
7170
|
-
);
|
|
7171
|
-
}
|
|
7172
|
-
},
|
|
7173
|
-
unmount() {
|
|
7174
|
-
if (isMounted) {
|
|
7175
|
-
render(null, app._container);
|
|
7176
|
-
if (process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) {
|
|
7177
|
-
app._instance = null;
|
|
7178
|
-
devtoolsUnmountApp(app);
|
|
7179
|
-
}
|
|
7180
|
-
delete app._container.__vue_app__;
|
|
7181
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
7182
|
-
warn(`Cannot unmount an app that is not mounted.`);
|
|
7183
|
-
}
|
|
7184
|
-
},
|
|
7185
|
-
provide(key, value) {
|
|
7186
|
-
if (process.env.NODE_ENV !== "production" && key in context.provides) {
|
|
7187
|
-
warn(
|
|
7188
|
-
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
7189
|
-
);
|
|
7144
|
+
}
|
|
7145
|
+
};
|
|
7146
|
+
const normalizeVNodeSlots = (instance, children) => {
|
|
7147
|
+
if (process.env.NODE_ENV !== "production" && !isKeepAlive(instance.vnode) && !isCompatEnabled("RENDER_FUNCTION", instance)) {
|
|
7148
|
+
warn(
|
|
7149
|
+
`Non-function value encountered for default slot. Prefer function slots for better performance.`
|
|
7150
|
+
);
|
|
7151
|
+
}
|
|
7152
|
+
const normalized = normalizeSlotValue(children);
|
|
7153
|
+
instance.slots.default = () => normalized;
|
|
7154
|
+
};
|
|
7155
|
+
const initSlots = (instance, children) => {
|
|
7156
|
+
if (instance.vnode.shapeFlag & 32) {
|
|
7157
|
+
const type = children._;
|
|
7158
|
+
if (type) {
|
|
7159
|
+
instance.slots = toRaw(children);
|
|
7160
|
+
def(children, "_", type);
|
|
7161
|
+
} else {
|
|
7162
|
+
normalizeObjectSlots(
|
|
7163
|
+
children,
|
|
7164
|
+
instance.slots = {},
|
|
7165
|
+
instance
|
|
7166
|
+
);
|
|
7167
|
+
}
|
|
7168
|
+
} else {
|
|
7169
|
+
instance.slots = {};
|
|
7170
|
+
if (children) {
|
|
7171
|
+
normalizeVNodeSlots(instance, children);
|
|
7172
|
+
}
|
|
7173
|
+
}
|
|
7174
|
+
def(instance.slots, InternalObjectKey, 1);
|
|
7175
|
+
};
|
|
7176
|
+
const updateSlots = (instance, children, optimized) => {
|
|
7177
|
+
const { vnode, slots } = instance;
|
|
7178
|
+
let needDeletionCheck = true;
|
|
7179
|
+
let deletionComparisonTarget = EMPTY_OBJ;
|
|
7180
|
+
if (vnode.shapeFlag & 32) {
|
|
7181
|
+
const type = children._;
|
|
7182
|
+
if (type) {
|
|
7183
|
+
if (process.env.NODE_ENV !== "production" && isHmrUpdating) {
|
|
7184
|
+
extend(slots, children);
|
|
7185
|
+
} else if (optimized && type === 1) {
|
|
7186
|
+
needDeletionCheck = false;
|
|
7187
|
+
} else {
|
|
7188
|
+
extend(slots, children);
|
|
7189
|
+
if (!optimized && type === 1) {
|
|
7190
|
+
delete slots._;
|
|
7190
7191
|
}
|
|
7191
|
-
context.provides[key] = value;
|
|
7192
|
-
return app;
|
|
7193
7192
|
}
|
|
7194
|
-
}
|
|
7195
|
-
|
|
7196
|
-
|
|
7193
|
+
} else {
|
|
7194
|
+
needDeletionCheck = !children.$stable;
|
|
7195
|
+
normalizeObjectSlots(children, slots, instance);
|
|
7197
7196
|
}
|
|
7198
|
-
|
|
7199
|
-
}
|
|
7200
|
-
|
|
7197
|
+
deletionComparisonTarget = children;
|
|
7198
|
+
} else if (children) {
|
|
7199
|
+
normalizeVNodeSlots(instance, children);
|
|
7200
|
+
deletionComparisonTarget = { default: 1 };
|
|
7201
|
+
}
|
|
7202
|
+
if (needDeletionCheck) {
|
|
7203
|
+
for (const key in slots) {
|
|
7204
|
+
if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
|
|
7205
|
+
delete slots[key];
|
|
7206
|
+
}
|
|
7207
|
+
}
|
|
7208
|
+
}
|
|
7209
|
+
};
|
|
7201
7210
|
|
|
7202
7211
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
7203
7212
|
if (isArray(rawRef)) {
|
|
@@ -10408,6 +10417,12 @@ function defineSlots() {
|
|
|
10408
10417
|
if (process.env.NODE_ENV !== "production") {
|
|
10409
10418
|
warnRuntimeUsage(`defineSlots`);
|
|
10410
10419
|
}
|
|
10420
|
+
return null;
|
|
10421
|
+
}
|
|
10422
|
+
function defineModel() {
|
|
10423
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10424
|
+
warnRuntimeUsage("defineModel");
|
|
10425
|
+
}
|
|
10411
10426
|
}
|
|
10412
10427
|
function withDefaults(props, defaults) {
|
|
10413
10428
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -10421,6 +10436,40 @@ function useSlots() {
|
|
|
10421
10436
|
function useAttrs() {
|
|
10422
10437
|
return getContext().attrs;
|
|
10423
10438
|
}
|
|
10439
|
+
function useModel(props, name, options) {
|
|
10440
|
+
const i = getCurrentInstance();
|
|
10441
|
+
if (process.env.NODE_ENV !== "production" && !i) {
|
|
10442
|
+
warn(`useModel() called without active instance.`);
|
|
10443
|
+
return ref();
|
|
10444
|
+
}
|
|
10445
|
+
if (process.env.NODE_ENV !== "production" && !i.propsOptions[0][name]) {
|
|
10446
|
+
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
10447
|
+
return ref();
|
|
10448
|
+
}
|
|
10449
|
+
if (options && options.local) {
|
|
10450
|
+
const proxy = ref(props[name]);
|
|
10451
|
+
watch(
|
|
10452
|
+
() => props[name],
|
|
10453
|
+
(v) => proxy.value = v
|
|
10454
|
+
);
|
|
10455
|
+
watch(proxy, (value) => {
|
|
10456
|
+
if (value !== props[name]) {
|
|
10457
|
+
i.emit(`update:${name}`, value);
|
|
10458
|
+
}
|
|
10459
|
+
});
|
|
10460
|
+
return proxy;
|
|
10461
|
+
} else {
|
|
10462
|
+
return {
|
|
10463
|
+
__v_isRef: true,
|
|
10464
|
+
get value() {
|
|
10465
|
+
return props[name];
|
|
10466
|
+
},
|
|
10467
|
+
set value(value) {
|
|
10468
|
+
i.emit(`update:${name}`, value);
|
|
10469
|
+
}
|
|
10470
|
+
};
|
|
10471
|
+
}
|
|
10472
|
+
}
|
|
10424
10473
|
function getContext() {
|
|
10425
10474
|
const i = getCurrentInstance();
|
|
10426
10475
|
if (process.env.NODE_ENV !== "production" && !i) {
|
|
@@ -10428,11 +10477,14 @@ function getContext() {
|
|
|
10428
10477
|
}
|
|
10429
10478
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
10430
10479
|
}
|
|
10431
|
-
function
|
|
10432
|
-
|
|
10480
|
+
function normalizePropsOrEmits(props) {
|
|
10481
|
+
return isArray(props) ? props.reduce(
|
|
10433
10482
|
(normalized, p) => (normalized[p] = {}, normalized),
|
|
10434
10483
|
{}
|
|
10435
|
-
) :
|
|
10484
|
+
) : props;
|
|
10485
|
+
}
|
|
10486
|
+
function mergeDefaults(raw, defaults) {
|
|
10487
|
+
const props = normalizePropsOrEmits(raw);
|
|
10436
10488
|
for (const key in defaults) {
|
|
10437
10489
|
if (key.startsWith("__skip"))
|
|
10438
10490
|
continue;
|
|
@@ -10454,6 +10506,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
10454
10506
|
}
|
|
10455
10507
|
return props;
|
|
10456
10508
|
}
|
|
10509
|
+
function mergeModels(a, b) {
|
|
10510
|
+
if (!a || !b)
|
|
10511
|
+
return a || b;
|
|
10512
|
+
if (isArray(a) && isArray(b))
|
|
10513
|
+
return a.concat(b);
|
|
10514
|
+
return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
10515
|
+
}
|
|
10457
10516
|
function createPropsRestProxy(props, excludedKeys) {
|
|
10458
10517
|
const ret = {};
|
|
10459
10518
|
for (const key in props) {
|
|
@@ -10719,7 +10778,7 @@ function isMemoSame(cached, memo) {
|
|
|
10719
10778
|
return true;
|
|
10720
10779
|
}
|
|
10721
10780
|
|
|
10722
|
-
const version = "3.3.0-alpha.
|
|
10781
|
+
const version = "3.3.0-alpha.9";
|
|
10723
10782
|
const _ssrUtils = {
|
|
10724
10783
|
createComponentInstance,
|
|
10725
10784
|
setupComponent,
|
|
@@ -12431,6 +12490,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12431
12490
|
defineCustomElement: defineCustomElement,
|
|
12432
12491
|
defineEmits: defineEmits,
|
|
12433
12492
|
defineExpose: defineExpose,
|
|
12493
|
+
defineModel: defineModel,
|
|
12434
12494
|
defineOptions: defineOptions,
|
|
12435
12495
|
defineProps: defineProps,
|
|
12436
12496
|
defineSSRCustomElement: defineSSRCustomElement,
|
|
@@ -12458,6 +12518,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12458
12518
|
isVNode: isVNode,
|
|
12459
12519
|
markRaw: markRaw,
|
|
12460
12520
|
mergeDefaults: mergeDefaults,
|
|
12521
|
+
mergeModels: mergeModels,
|
|
12461
12522
|
mergeProps: mergeProps,
|
|
12462
12523
|
nextTick: nextTick,
|
|
12463
12524
|
normalizeClass: normalizeClass,
|
|
@@ -12516,6 +12577,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12516
12577
|
useAttrs: useAttrs,
|
|
12517
12578
|
useCssModule: useCssModule,
|
|
12518
12579
|
useCssVars: useCssVars,
|
|
12580
|
+
useModel: useModel,
|
|
12519
12581
|
useSSRContext: useSSRContext,
|
|
12520
12582
|
useSlots: useSlots,
|
|
12521
12583
|
useTransitionState: useTransitionState,
|
|
@@ -12580,4 +12642,4 @@ var Vue$1 = Vue;
|
|
|
12580
12642
|
|
|
12581
12643
|
const { configureCompat } = Vue$1;
|
|
12582
12644
|
|
|
12583
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
12645
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|