@vue/runtime-dom 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.
|
@@ -2998,36 +2998,6 @@ function setActiveBranch(suspense, branch) {
|
|
|
2998
2998
|
}
|
|
2999
2999
|
}
|
|
3000
3000
|
|
|
3001
|
-
function provide(key, value) {
|
|
3002
|
-
if (!currentInstance) {
|
|
3003
|
-
{
|
|
3004
|
-
warn(`provide() can only be used inside setup().`);
|
|
3005
|
-
}
|
|
3006
|
-
} else {
|
|
3007
|
-
let provides = currentInstance.provides;
|
|
3008
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
3009
|
-
if (parentProvides === provides) {
|
|
3010
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
3011
|
-
}
|
|
3012
|
-
provides[key] = value;
|
|
3013
|
-
}
|
|
3014
|
-
}
|
|
3015
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
3016
|
-
const instance = currentInstance || currentRenderingInstance;
|
|
3017
|
-
if (instance) {
|
|
3018
|
-
const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
|
|
3019
|
-
if (provides && key in provides) {
|
|
3020
|
-
return provides[key];
|
|
3021
|
-
} else if (arguments.length > 1) {
|
|
3022
|
-
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
|
|
3023
|
-
} else {
|
|
3024
|
-
warn(`injection "${String(key)}" not found.`);
|
|
3025
|
-
}
|
|
3026
|
-
} else {
|
|
3027
|
-
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
3001
|
function watchEffect(effect, options) {
|
|
3032
3002
|
return doWatch(effect, null, options);
|
|
3033
3003
|
}
|
|
@@ -3253,6 +3223,65 @@ function traverse(value, seen) {
|
|
|
3253
3223
|
return value;
|
|
3254
3224
|
}
|
|
3255
3225
|
|
|
3226
|
+
function validateDirectiveName(name) {
|
|
3227
|
+
if (isBuiltInDirective(name)) {
|
|
3228
|
+
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
function withDirectives(vnode, directives) {
|
|
3232
|
+
const internalInstance = currentRenderingInstance;
|
|
3233
|
+
if (internalInstance === null) {
|
|
3234
|
+
warn(`withDirectives can only be used inside render functions.`);
|
|
3235
|
+
return vnode;
|
|
3236
|
+
}
|
|
3237
|
+
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
3238
|
+
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
3239
|
+
for (let i = 0; i < directives.length; i++) {
|
|
3240
|
+
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
3241
|
+
if (dir) {
|
|
3242
|
+
if (isFunction(dir)) {
|
|
3243
|
+
dir = {
|
|
3244
|
+
mounted: dir,
|
|
3245
|
+
updated: dir
|
|
3246
|
+
};
|
|
3247
|
+
}
|
|
3248
|
+
if (dir.deep) {
|
|
3249
|
+
traverse(value);
|
|
3250
|
+
}
|
|
3251
|
+
bindings.push({
|
|
3252
|
+
dir,
|
|
3253
|
+
instance,
|
|
3254
|
+
value,
|
|
3255
|
+
oldValue: void 0,
|
|
3256
|
+
arg,
|
|
3257
|
+
modifiers
|
|
3258
|
+
});
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
return vnode;
|
|
3262
|
+
}
|
|
3263
|
+
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3264
|
+
const bindings = vnode.dirs;
|
|
3265
|
+
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3266
|
+
for (let i = 0; i < bindings.length; i++) {
|
|
3267
|
+
const binding = bindings[i];
|
|
3268
|
+
if (oldBindings) {
|
|
3269
|
+
binding.oldValue = oldBindings[i].value;
|
|
3270
|
+
}
|
|
3271
|
+
let hook = binding.dir[name];
|
|
3272
|
+
if (hook) {
|
|
3273
|
+
pauseTracking();
|
|
3274
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3275
|
+
vnode.el,
|
|
3276
|
+
binding,
|
|
3277
|
+
vnode,
|
|
3278
|
+
prevVNode
|
|
3279
|
+
]);
|
|
3280
|
+
resetTracking();
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3256
3285
|
function useTransitionState() {
|
|
3257
3286
|
const state = {
|
|
3258
3287
|
isMounted: false,
|
|
@@ -4010,65 +4039,6 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
4010
4039
|
injectHook("ec", hook, target);
|
|
4011
4040
|
}
|
|
4012
4041
|
|
|
4013
|
-
function validateDirectiveName(name) {
|
|
4014
|
-
if (isBuiltInDirective(name)) {
|
|
4015
|
-
warn("Do not use built-in directive ids as custom directive id: " + name);
|
|
4016
|
-
}
|
|
4017
|
-
}
|
|
4018
|
-
function withDirectives(vnode, directives) {
|
|
4019
|
-
const internalInstance = currentRenderingInstance;
|
|
4020
|
-
if (internalInstance === null) {
|
|
4021
|
-
warn(`withDirectives can only be used inside render functions.`);
|
|
4022
|
-
return vnode;
|
|
4023
|
-
}
|
|
4024
|
-
const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
|
|
4025
|
-
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
4026
|
-
for (let i = 0; i < directives.length; i++) {
|
|
4027
|
-
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
4028
|
-
if (dir) {
|
|
4029
|
-
if (isFunction(dir)) {
|
|
4030
|
-
dir = {
|
|
4031
|
-
mounted: dir,
|
|
4032
|
-
updated: dir
|
|
4033
|
-
};
|
|
4034
|
-
}
|
|
4035
|
-
if (dir.deep) {
|
|
4036
|
-
traverse(value);
|
|
4037
|
-
}
|
|
4038
|
-
bindings.push({
|
|
4039
|
-
dir,
|
|
4040
|
-
instance,
|
|
4041
|
-
value,
|
|
4042
|
-
oldValue: void 0,
|
|
4043
|
-
arg,
|
|
4044
|
-
modifiers
|
|
4045
|
-
});
|
|
4046
|
-
}
|
|
4047
|
-
}
|
|
4048
|
-
return vnode;
|
|
4049
|
-
}
|
|
4050
|
-
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
4051
|
-
const bindings = vnode.dirs;
|
|
4052
|
-
const oldBindings = prevVNode && prevVNode.dirs;
|
|
4053
|
-
for (let i = 0; i < bindings.length; i++) {
|
|
4054
|
-
const binding = bindings[i];
|
|
4055
|
-
if (oldBindings) {
|
|
4056
|
-
binding.oldValue = oldBindings[i].value;
|
|
4057
|
-
}
|
|
4058
|
-
let hook = binding.dir[name];
|
|
4059
|
-
if (hook) {
|
|
4060
|
-
pauseTracking();
|
|
4061
|
-
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
4062
|
-
vnode.el,
|
|
4063
|
-
binding,
|
|
4064
|
-
vnode,
|
|
4065
|
-
prevVNode
|
|
4066
|
-
]);
|
|
4067
|
-
resetTracking();
|
|
4068
|
-
}
|
|
4069
|
-
}
|
|
4070
|
-
}
|
|
4071
|
-
|
|
4072
4042
|
const COMPONENTS = "components";
|
|
4073
4043
|
const DIRECTIVES = "directives";
|
|
4074
4044
|
function resolveComponent(name, maybeSelfReference) {
|
|
@@ -4870,35 +4840,244 @@ function mergeDataFn(to, from) {
|
|
|
4870
4840
|
);
|
|
4871
4841
|
};
|
|
4872
4842
|
}
|
|
4873
|
-
function mergeInject(to, from) {
|
|
4874
|
-
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
4875
|
-
}
|
|
4876
|
-
function normalizeInject(raw) {
|
|
4877
|
-
if (isArray(raw)) {
|
|
4878
|
-
const res = {};
|
|
4879
|
-
for (let i = 0; i < raw.length; i++) {
|
|
4880
|
-
res[raw[i]] = raw[i];
|
|
4843
|
+
function mergeInject(to, from) {
|
|
4844
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
4845
|
+
}
|
|
4846
|
+
function normalizeInject(raw) {
|
|
4847
|
+
if (isArray(raw)) {
|
|
4848
|
+
const res = {};
|
|
4849
|
+
for (let i = 0; i < raw.length; i++) {
|
|
4850
|
+
res[raw[i]] = raw[i];
|
|
4851
|
+
}
|
|
4852
|
+
return res;
|
|
4853
|
+
}
|
|
4854
|
+
return raw;
|
|
4855
|
+
}
|
|
4856
|
+
function mergeAsArray(to, from) {
|
|
4857
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
4858
|
+
}
|
|
4859
|
+
function mergeObjectOptions(to, from) {
|
|
4860
|
+
return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
|
|
4861
|
+
}
|
|
4862
|
+
function mergeWatchOptions(to, from) {
|
|
4863
|
+
if (!to)
|
|
4864
|
+
return from;
|
|
4865
|
+
if (!from)
|
|
4866
|
+
return to;
|
|
4867
|
+
const merged = extend(/* @__PURE__ */ Object.create(null), to);
|
|
4868
|
+
for (const key in from) {
|
|
4869
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
4870
|
+
}
|
|
4871
|
+
return merged;
|
|
4872
|
+
}
|
|
4873
|
+
|
|
4874
|
+
function createAppContext() {
|
|
4875
|
+
return {
|
|
4876
|
+
app: null,
|
|
4877
|
+
config: {
|
|
4878
|
+
isNativeTag: NO,
|
|
4879
|
+
performance: false,
|
|
4880
|
+
globalProperties: {},
|
|
4881
|
+
optionMergeStrategies: {},
|
|
4882
|
+
errorHandler: void 0,
|
|
4883
|
+
warnHandler: void 0,
|
|
4884
|
+
compilerOptions: {}
|
|
4885
|
+
},
|
|
4886
|
+
mixins: [],
|
|
4887
|
+
components: {},
|
|
4888
|
+
directives: {},
|
|
4889
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
4890
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
4891
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
4892
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
4893
|
+
};
|
|
4894
|
+
}
|
|
4895
|
+
let uid$1 = 0;
|
|
4896
|
+
function createAppAPI(render, hydrate) {
|
|
4897
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
4898
|
+
if (!isFunction(rootComponent)) {
|
|
4899
|
+
rootComponent = extend({}, rootComponent);
|
|
4900
|
+
}
|
|
4901
|
+
if (rootProps != null && !isObject(rootProps)) {
|
|
4902
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
4903
|
+
rootProps = null;
|
|
4904
|
+
}
|
|
4905
|
+
const context = createAppContext();
|
|
4906
|
+
const installedPlugins = /* @__PURE__ */ new Set();
|
|
4907
|
+
let isMounted = false;
|
|
4908
|
+
const app = context.app = {
|
|
4909
|
+
_uid: uid$1++,
|
|
4910
|
+
_component: rootComponent,
|
|
4911
|
+
_props: rootProps,
|
|
4912
|
+
_container: null,
|
|
4913
|
+
_context: context,
|
|
4914
|
+
_instance: null,
|
|
4915
|
+
version,
|
|
4916
|
+
get config() {
|
|
4917
|
+
return context.config;
|
|
4918
|
+
},
|
|
4919
|
+
set config(v) {
|
|
4920
|
+
{
|
|
4921
|
+
warn(
|
|
4922
|
+
`app.config cannot be replaced. Modify individual options instead.`
|
|
4923
|
+
);
|
|
4924
|
+
}
|
|
4925
|
+
},
|
|
4926
|
+
use(plugin, ...options) {
|
|
4927
|
+
if (installedPlugins.has(plugin)) {
|
|
4928
|
+
warn(`Plugin has already been applied to target app.`);
|
|
4929
|
+
} else if (plugin && isFunction(plugin.install)) {
|
|
4930
|
+
installedPlugins.add(plugin);
|
|
4931
|
+
plugin.install(app, ...options);
|
|
4932
|
+
} else if (isFunction(plugin)) {
|
|
4933
|
+
installedPlugins.add(plugin);
|
|
4934
|
+
plugin(app, ...options);
|
|
4935
|
+
} else {
|
|
4936
|
+
warn(
|
|
4937
|
+
`A plugin must either be a function or an object with an "install" function.`
|
|
4938
|
+
);
|
|
4939
|
+
}
|
|
4940
|
+
return app;
|
|
4941
|
+
},
|
|
4942
|
+
mixin(mixin) {
|
|
4943
|
+
{
|
|
4944
|
+
if (!context.mixins.includes(mixin)) {
|
|
4945
|
+
context.mixins.push(mixin);
|
|
4946
|
+
} else {
|
|
4947
|
+
warn(
|
|
4948
|
+
"Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
|
|
4949
|
+
);
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4952
|
+
return app;
|
|
4953
|
+
},
|
|
4954
|
+
component(name, component) {
|
|
4955
|
+
{
|
|
4956
|
+
validateComponentName(name, context.config);
|
|
4957
|
+
}
|
|
4958
|
+
if (!component) {
|
|
4959
|
+
return context.components[name];
|
|
4960
|
+
}
|
|
4961
|
+
if (context.components[name]) {
|
|
4962
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
4963
|
+
}
|
|
4964
|
+
context.components[name] = component;
|
|
4965
|
+
return app;
|
|
4966
|
+
},
|
|
4967
|
+
directive(name, directive) {
|
|
4968
|
+
{
|
|
4969
|
+
validateDirectiveName(name);
|
|
4970
|
+
}
|
|
4971
|
+
if (!directive) {
|
|
4972
|
+
return context.directives[name];
|
|
4973
|
+
}
|
|
4974
|
+
if (context.directives[name]) {
|
|
4975
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
4976
|
+
}
|
|
4977
|
+
context.directives[name] = directive;
|
|
4978
|
+
return app;
|
|
4979
|
+
},
|
|
4980
|
+
mount(rootContainer, isHydrate, isSVG) {
|
|
4981
|
+
if (!isMounted) {
|
|
4982
|
+
if (rootContainer.__vue_app__) {
|
|
4983
|
+
warn(
|
|
4984
|
+
`There is already an app instance mounted on the host container.
|
|
4985
|
+
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
4986
|
+
);
|
|
4987
|
+
}
|
|
4988
|
+
const vnode = createVNode(
|
|
4989
|
+
rootComponent,
|
|
4990
|
+
rootProps
|
|
4991
|
+
);
|
|
4992
|
+
vnode.appContext = context;
|
|
4993
|
+
{
|
|
4994
|
+
context.reload = () => {
|
|
4995
|
+
render(cloneVNode(vnode), rootContainer, isSVG);
|
|
4996
|
+
};
|
|
4997
|
+
}
|
|
4998
|
+
if (isHydrate && hydrate) {
|
|
4999
|
+
hydrate(vnode, rootContainer);
|
|
5000
|
+
} else {
|
|
5001
|
+
render(vnode, rootContainer, isSVG);
|
|
5002
|
+
}
|
|
5003
|
+
isMounted = true;
|
|
5004
|
+
app._container = rootContainer;
|
|
5005
|
+
rootContainer.__vue_app__ = app;
|
|
5006
|
+
{
|
|
5007
|
+
app._instance = vnode.component;
|
|
5008
|
+
devtoolsInitApp(app, version);
|
|
5009
|
+
}
|
|
5010
|
+
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
5011
|
+
} else {
|
|
5012
|
+
warn(
|
|
5013
|
+
`App has already been mounted.
|
|
5014
|
+
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)\``
|
|
5015
|
+
);
|
|
5016
|
+
}
|
|
5017
|
+
},
|
|
5018
|
+
unmount() {
|
|
5019
|
+
if (isMounted) {
|
|
5020
|
+
render(null, app._container);
|
|
5021
|
+
{
|
|
5022
|
+
app._instance = null;
|
|
5023
|
+
devtoolsUnmountApp(app);
|
|
5024
|
+
}
|
|
5025
|
+
delete app._container.__vue_app__;
|
|
5026
|
+
} else {
|
|
5027
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
5028
|
+
}
|
|
5029
|
+
},
|
|
5030
|
+
provide(key, value) {
|
|
5031
|
+
if (key in context.provides) {
|
|
5032
|
+
warn(
|
|
5033
|
+
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
5034
|
+
);
|
|
5035
|
+
}
|
|
5036
|
+
context.provides[key] = value;
|
|
5037
|
+
return app;
|
|
5038
|
+
},
|
|
5039
|
+
runWithContext(fn) {
|
|
5040
|
+
currentApp = app;
|
|
5041
|
+
try {
|
|
5042
|
+
return fn();
|
|
5043
|
+
} finally {
|
|
5044
|
+
currentApp = null;
|
|
5045
|
+
}
|
|
5046
|
+
}
|
|
5047
|
+
};
|
|
5048
|
+
return app;
|
|
5049
|
+
};
|
|
5050
|
+
}
|
|
5051
|
+
let currentApp = null;
|
|
5052
|
+
|
|
5053
|
+
function provide(key, value) {
|
|
5054
|
+
if (!currentInstance) {
|
|
5055
|
+
{
|
|
5056
|
+
warn(`provide() can only be used inside setup().`);
|
|
4881
5057
|
}
|
|
4882
|
-
|
|
5058
|
+
} else {
|
|
5059
|
+
let provides = currentInstance.provides;
|
|
5060
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
5061
|
+
if (parentProvides === provides) {
|
|
5062
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
5063
|
+
}
|
|
5064
|
+
provides[key] = value;
|
|
4883
5065
|
}
|
|
4884
|
-
return raw;
|
|
4885
|
-
}
|
|
4886
|
-
function mergeAsArray(to, from) {
|
|
4887
|
-
return to ? [...new Set([].concat(to, from))] : from;
|
|
4888
5066
|
}
|
|
4889
|
-
function
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
5067
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
5068
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
5069
|
+
if (instance || currentApp) {
|
|
5070
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
|
|
5071
|
+
if (provides && key in provides) {
|
|
5072
|
+
return provides[key];
|
|
5073
|
+
} else if (arguments.length > 1) {
|
|
5074
|
+
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
5075
|
+
} else {
|
|
5076
|
+
warn(`injection "${String(key)}" not found.`);
|
|
5077
|
+
}
|
|
5078
|
+
} else {
|
|
5079
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
4900
5080
|
}
|
|
4901
|
-
return merged;
|
|
4902
5081
|
}
|
|
4903
5082
|
|
|
4904
5083
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
@@ -5216,7 +5395,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
5216
5395
|
warn('Missing required prop: "' + name + '"');
|
|
5217
5396
|
return;
|
|
5218
5397
|
}
|
|
5219
|
-
if (value == null && !
|
|
5398
|
+
if (value == null && !required) {
|
|
5220
5399
|
return;
|
|
5221
5400
|
}
|
|
5222
5401
|
if (type != null && type !== true && !skipCheck) {
|
|
@@ -5394,176 +5573,6 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
5394
5573
|
}
|
|
5395
5574
|
};
|
|
5396
5575
|
|
|
5397
|
-
function createAppContext() {
|
|
5398
|
-
return {
|
|
5399
|
-
app: null,
|
|
5400
|
-
config: {
|
|
5401
|
-
isNativeTag: NO,
|
|
5402
|
-
performance: false,
|
|
5403
|
-
globalProperties: {},
|
|
5404
|
-
optionMergeStrategies: {},
|
|
5405
|
-
errorHandler: void 0,
|
|
5406
|
-
warnHandler: void 0,
|
|
5407
|
-
compilerOptions: {}
|
|
5408
|
-
},
|
|
5409
|
-
mixins: [],
|
|
5410
|
-
components: {},
|
|
5411
|
-
directives: {},
|
|
5412
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
5413
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
5414
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
5415
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
5416
|
-
};
|
|
5417
|
-
}
|
|
5418
|
-
let uid$1 = 0;
|
|
5419
|
-
function createAppAPI(render, hydrate) {
|
|
5420
|
-
return function createApp(rootComponent, rootProps = null) {
|
|
5421
|
-
if (!isFunction(rootComponent)) {
|
|
5422
|
-
rootComponent = extend({}, rootComponent);
|
|
5423
|
-
}
|
|
5424
|
-
if (rootProps != null && !isObject(rootProps)) {
|
|
5425
|
-
warn(`root props passed to app.mount() must be an object.`);
|
|
5426
|
-
rootProps = null;
|
|
5427
|
-
}
|
|
5428
|
-
const context = createAppContext();
|
|
5429
|
-
const installedPlugins = /* @__PURE__ */ new Set();
|
|
5430
|
-
let isMounted = false;
|
|
5431
|
-
const app = context.app = {
|
|
5432
|
-
_uid: uid$1++,
|
|
5433
|
-
_component: rootComponent,
|
|
5434
|
-
_props: rootProps,
|
|
5435
|
-
_container: null,
|
|
5436
|
-
_context: context,
|
|
5437
|
-
_instance: null,
|
|
5438
|
-
version,
|
|
5439
|
-
get config() {
|
|
5440
|
-
return context.config;
|
|
5441
|
-
},
|
|
5442
|
-
set config(v) {
|
|
5443
|
-
{
|
|
5444
|
-
warn(
|
|
5445
|
-
`app.config cannot be replaced. Modify individual options instead.`
|
|
5446
|
-
);
|
|
5447
|
-
}
|
|
5448
|
-
},
|
|
5449
|
-
use(plugin, ...options) {
|
|
5450
|
-
if (installedPlugins.has(plugin)) {
|
|
5451
|
-
warn(`Plugin has already been applied to target app.`);
|
|
5452
|
-
} else if (plugin && isFunction(plugin.install)) {
|
|
5453
|
-
installedPlugins.add(plugin);
|
|
5454
|
-
plugin.install(app, ...options);
|
|
5455
|
-
} else if (isFunction(plugin)) {
|
|
5456
|
-
installedPlugins.add(plugin);
|
|
5457
|
-
plugin(app, ...options);
|
|
5458
|
-
} else {
|
|
5459
|
-
warn(
|
|
5460
|
-
`A plugin must either be a function or an object with an "install" function.`
|
|
5461
|
-
);
|
|
5462
|
-
}
|
|
5463
|
-
return app;
|
|
5464
|
-
},
|
|
5465
|
-
mixin(mixin) {
|
|
5466
|
-
{
|
|
5467
|
-
if (!context.mixins.includes(mixin)) {
|
|
5468
|
-
context.mixins.push(mixin);
|
|
5469
|
-
} else {
|
|
5470
|
-
warn(
|
|
5471
|
-
"Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
|
|
5472
|
-
);
|
|
5473
|
-
}
|
|
5474
|
-
}
|
|
5475
|
-
return app;
|
|
5476
|
-
},
|
|
5477
|
-
component(name, component) {
|
|
5478
|
-
{
|
|
5479
|
-
validateComponentName(name, context.config);
|
|
5480
|
-
}
|
|
5481
|
-
if (!component) {
|
|
5482
|
-
return context.components[name];
|
|
5483
|
-
}
|
|
5484
|
-
if (context.components[name]) {
|
|
5485
|
-
warn(`Component "${name}" has already been registered in target app.`);
|
|
5486
|
-
}
|
|
5487
|
-
context.components[name] = component;
|
|
5488
|
-
return app;
|
|
5489
|
-
},
|
|
5490
|
-
directive(name, directive) {
|
|
5491
|
-
{
|
|
5492
|
-
validateDirectiveName(name);
|
|
5493
|
-
}
|
|
5494
|
-
if (!directive) {
|
|
5495
|
-
return context.directives[name];
|
|
5496
|
-
}
|
|
5497
|
-
if (context.directives[name]) {
|
|
5498
|
-
warn(`Directive "${name}" has already been registered in target app.`);
|
|
5499
|
-
}
|
|
5500
|
-
context.directives[name] = directive;
|
|
5501
|
-
return app;
|
|
5502
|
-
},
|
|
5503
|
-
mount(rootContainer, isHydrate, isSVG) {
|
|
5504
|
-
if (!isMounted) {
|
|
5505
|
-
if (rootContainer.__vue_app__) {
|
|
5506
|
-
warn(
|
|
5507
|
-
`There is already an app instance mounted on the host container.
|
|
5508
|
-
If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
|
|
5509
|
-
);
|
|
5510
|
-
}
|
|
5511
|
-
const vnode = createVNode(
|
|
5512
|
-
rootComponent,
|
|
5513
|
-
rootProps
|
|
5514
|
-
);
|
|
5515
|
-
vnode.appContext = context;
|
|
5516
|
-
{
|
|
5517
|
-
context.reload = () => {
|
|
5518
|
-
render(cloneVNode(vnode), rootContainer, isSVG);
|
|
5519
|
-
};
|
|
5520
|
-
}
|
|
5521
|
-
if (isHydrate && hydrate) {
|
|
5522
|
-
hydrate(vnode, rootContainer);
|
|
5523
|
-
} else {
|
|
5524
|
-
render(vnode, rootContainer, isSVG);
|
|
5525
|
-
}
|
|
5526
|
-
isMounted = true;
|
|
5527
|
-
app._container = rootContainer;
|
|
5528
|
-
rootContainer.__vue_app__ = app;
|
|
5529
|
-
{
|
|
5530
|
-
app._instance = vnode.component;
|
|
5531
|
-
devtoolsInitApp(app, version);
|
|
5532
|
-
}
|
|
5533
|
-
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
5534
|
-
} else {
|
|
5535
|
-
warn(
|
|
5536
|
-
`App has already been mounted.
|
|
5537
|
-
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)\``
|
|
5538
|
-
);
|
|
5539
|
-
}
|
|
5540
|
-
},
|
|
5541
|
-
unmount() {
|
|
5542
|
-
if (isMounted) {
|
|
5543
|
-
render(null, app._container);
|
|
5544
|
-
{
|
|
5545
|
-
app._instance = null;
|
|
5546
|
-
devtoolsUnmountApp(app);
|
|
5547
|
-
}
|
|
5548
|
-
delete app._container.__vue_app__;
|
|
5549
|
-
} else {
|
|
5550
|
-
warn(`Cannot unmount an app that is not mounted.`);
|
|
5551
|
-
}
|
|
5552
|
-
},
|
|
5553
|
-
provide(key, value) {
|
|
5554
|
-
if (key in context.provides) {
|
|
5555
|
-
warn(
|
|
5556
|
-
`App already provides property with key "${String(key)}". It will be overwritten with the new value.`
|
|
5557
|
-
);
|
|
5558
|
-
}
|
|
5559
|
-
context.provides[key] = value;
|
|
5560
|
-
return app;
|
|
5561
|
-
}
|
|
5562
|
-
};
|
|
5563
|
-
return app;
|
|
5564
|
-
};
|
|
5565
|
-
}
|
|
5566
|
-
|
|
5567
5576
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
5568
5577
|
if (isArray(rawRef)) {
|
|
5569
5578
|
rawRef.forEach(
|
|
@@ -8617,6 +8626,12 @@ function defineSlots() {
|
|
|
8617
8626
|
{
|
|
8618
8627
|
warnRuntimeUsage(`defineSlots`);
|
|
8619
8628
|
}
|
|
8629
|
+
return null;
|
|
8630
|
+
}
|
|
8631
|
+
function defineModel() {
|
|
8632
|
+
{
|
|
8633
|
+
warnRuntimeUsage("defineModel");
|
|
8634
|
+
}
|
|
8620
8635
|
}
|
|
8621
8636
|
function withDefaults(props, defaults) {
|
|
8622
8637
|
{
|
|
@@ -8630,6 +8645,40 @@ function useSlots() {
|
|
|
8630
8645
|
function useAttrs() {
|
|
8631
8646
|
return getContext().attrs;
|
|
8632
8647
|
}
|
|
8648
|
+
function useModel(props, name, options) {
|
|
8649
|
+
const i = getCurrentInstance();
|
|
8650
|
+
if (!i) {
|
|
8651
|
+
warn(`useModel() called without active instance.`);
|
|
8652
|
+
return ref();
|
|
8653
|
+
}
|
|
8654
|
+
if (!i.propsOptions[0][name]) {
|
|
8655
|
+
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
8656
|
+
return ref();
|
|
8657
|
+
}
|
|
8658
|
+
if (options && options.local) {
|
|
8659
|
+
const proxy = ref(props[name]);
|
|
8660
|
+
watch(
|
|
8661
|
+
() => props[name],
|
|
8662
|
+
(v) => proxy.value = v
|
|
8663
|
+
);
|
|
8664
|
+
watch(proxy, (value) => {
|
|
8665
|
+
if (value !== props[name]) {
|
|
8666
|
+
i.emit(`update:${name}`, value);
|
|
8667
|
+
}
|
|
8668
|
+
});
|
|
8669
|
+
return proxy;
|
|
8670
|
+
} else {
|
|
8671
|
+
return {
|
|
8672
|
+
__v_isRef: true,
|
|
8673
|
+
get value() {
|
|
8674
|
+
return props[name];
|
|
8675
|
+
},
|
|
8676
|
+
set value(value) {
|
|
8677
|
+
i.emit(`update:${name}`, value);
|
|
8678
|
+
}
|
|
8679
|
+
};
|
|
8680
|
+
}
|
|
8681
|
+
}
|
|
8633
8682
|
function getContext() {
|
|
8634
8683
|
const i = getCurrentInstance();
|
|
8635
8684
|
if (!i) {
|
|
@@ -8637,11 +8686,14 @@ function getContext() {
|
|
|
8637
8686
|
}
|
|
8638
8687
|
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
8639
8688
|
}
|
|
8640
|
-
function
|
|
8641
|
-
|
|
8689
|
+
function normalizePropsOrEmits(props) {
|
|
8690
|
+
return isArray(props) ? props.reduce(
|
|
8642
8691
|
(normalized, p) => (normalized[p] = {}, normalized),
|
|
8643
8692
|
{}
|
|
8644
|
-
) :
|
|
8693
|
+
) : props;
|
|
8694
|
+
}
|
|
8695
|
+
function mergeDefaults(raw, defaults) {
|
|
8696
|
+
const props = normalizePropsOrEmits(raw);
|
|
8645
8697
|
for (const key in defaults) {
|
|
8646
8698
|
if (key.startsWith("__skip"))
|
|
8647
8699
|
continue;
|
|
@@ -8663,6 +8715,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
8663
8715
|
}
|
|
8664
8716
|
return props;
|
|
8665
8717
|
}
|
|
8718
|
+
function mergeModels(a, b) {
|
|
8719
|
+
if (!a || !b)
|
|
8720
|
+
return a || b;
|
|
8721
|
+
if (isArray(a) && isArray(b))
|
|
8722
|
+
return a.concat(b);
|
|
8723
|
+
return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
8724
|
+
}
|
|
8666
8725
|
function createPropsRestProxy(props, excludedKeys) {
|
|
8667
8726
|
const ret = {};
|
|
8668
8727
|
for (const key in props) {
|
|
@@ -8928,7 +8987,7 @@ function isMemoSame(cached, memo) {
|
|
|
8928
8987
|
return true;
|
|
8929
8988
|
}
|
|
8930
8989
|
|
|
8931
|
-
const version = "3.3.0-alpha.
|
|
8990
|
+
const version = "3.3.0-alpha.9";
|
|
8932
8991
|
const ssrUtils = null;
|
|
8933
8992
|
const resolveFilter = null;
|
|
8934
8993
|
const compatUtils = null;
|
|
@@ -10397,4 +10456,4 @@ function normalizeContainer(container) {
|
|
|
10397
10456
|
}
|
|
10398
10457
|
const initDirectivesForSSR = NOOP;
|
|
10399
10458
|
|
|
10400
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, 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 };
|
|
10459
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, 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 };
|