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