vue 2.7.3 → 2.7.6
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.common.dev.js +3371 -3281
- package/dist/vue.common.prod.js +3 -3
- package/dist/vue.esm.browser.js +3581 -3492
- package/dist/vue.esm.browser.min.js +3 -3
- package/dist/vue.esm.js +3722 -3631
- package/dist/vue.js +3611 -3519
- package/dist/vue.min.js +3 -3
- package/dist/vue.runtime.common.dev.js +2768 -2678
- package/dist/vue.runtime.common.prod.js +3 -3
- package/dist/vue.runtime.esm.js +3066 -2975
- package/dist/vue.runtime.js +2761 -2669
- package/dist/vue.runtime.min.js +3 -3
- package/dist/vue.runtime.mjs +73 -8602
- package/package.json +2 -2
- package/packages/compiler-sfc/dist/compiler-sfc.js +1036 -1029
- package/packages/compiler-sfc/package.json +1 -1
- package/packages/compiler-sfc/src/parseComponent.ts +7 -4
- package/packages/compiler-sfc/test/parseComponent.spec.ts +6 -7
- package/src/core/components/keep-alive.ts +5 -4
- package/src/core/global-api/extend.ts +3 -1
- package/src/core/instance/init.ts +1 -1
- package/src/core/instance/lifecycle.ts +8 -3
- package/src/core/instance/render-helpers/render-static.ts +1 -1
- package/src/core/observer/index.ts +1 -1
- package/src/core/observer/traverse.ts +3 -0
- package/src/core/util/debug.ts +2 -1
- package/src/core/vdom/create-component.ts +5 -1
- package/src/platforms/web/runtime/components/transition-group.ts +2 -1
- package/src/v3/apiAsyncComponent.ts +117 -0
- package/src/v3/apiWatch.ts +6 -8
- package/src/v3/index.ts +6 -0
- package/src/v3/reactivity/ref.ts +11 -2
- package/types/options.d.ts +5 -3
- package/types/v3-component-public-instance.d.ts +36 -32
- package/types/v3-define-async-component.d.ts +26 -0
- package/types/v3-define-component.d.ts +25 -1
- package/types/v3-generated.d.ts +23 -0
- package/types/v3-setup-context.d.ts +1 -0
- package/types/vue.d.ts +36 -13
package/types/v3-generated.d.ts
CHANGED
|
@@ -2,6 +2,24 @@ declare type ASTModifiers = {
|
|
|
2
2
|
[key: string]: boolean;
|
|
3
3
|
};
|
|
4
4
|
|
|
5
|
+
declare type AsyncComponentFactory = () => {
|
|
6
|
+
component: Promise<any>;
|
|
7
|
+
loading?: any;
|
|
8
|
+
error?: any;
|
|
9
|
+
delay?: number;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare interface AsyncComponentOptions {
|
|
14
|
+
loader: Function;
|
|
15
|
+
loadingComponent?: any;
|
|
16
|
+
errorComponent?: any;
|
|
17
|
+
delay?: number;
|
|
18
|
+
timeout?: number;
|
|
19
|
+
suspensible?: boolean;
|
|
20
|
+
onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
|
21
|
+
}
|
|
22
|
+
|
|
5
23
|
declare type BaseTypes = string | number | boolean;
|
|
6
24
|
|
|
7
25
|
declare type Builtin = Primitive | Function | Date | Error | RegExp;
|
|
@@ -57,6 +75,8 @@ export declare type DeepReadonly<T> = T extends Builtin ? T : T extends Map<infe
|
|
|
57
75
|
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
58
76
|
} : Readonly<T>;
|
|
59
77
|
|
|
78
|
+
/* Excluded from this release type: defineAsyncComponent */
|
|
79
|
+
|
|
60
80
|
/* Excluded from this release type: defineComponent */
|
|
61
81
|
|
|
62
82
|
/**
|
|
@@ -346,6 +366,9 @@ export declare function useCssVars(getter: (vm: Record<string, any>, setupProxy:
|
|
|
346
366
|
|
|
347
367
|
/* Excluded from this release type: useSlots */
|
|
348
368
|
|
|
369
|
+
/**
|
|
370
|
+
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
|
371
|
+
*/
|
|
349
372
|
export declare const version: string;
|
|
350
373
|
|
|
351
374
|
/* Excluded from this release type: VNode */
|
package/types/vue.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import {
|
|
|
3
3
|
AsyncComponent,
|
|
4
4
|
ComponentOptions,
|
|
5
5
|
FunctionalComponentOptions,
|
|
6
|
-
WatchOptionsWithHandler,
|
|
7
|
-
WatchHandler,
|
|
8
6
|
DirectiveOptions,
|
|
9
7
|
DirectiveFunction,
|
|
10
8
|
RecordPropsDefinition,
|
|
@@ -14,6 +12,9 @@ import {
|
|
|
14
12
|
} from './options'
|
|
15
13
|
import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from './vnode'
|
|
16
14
|
import { PluginFunction, PluginObject } from './plugin'
|
|
15
|
+
import { DefineComponent } from './v3-define-component'
|
|
16
|
+
import { nextTick } from './v3-generated'
|
|
17
|
+
import { ComponentPublicInstance } from 'v3-component-public-instance'
|
|
17
18
|
|
|
18
19
|
export interface CreateElement {
|
|
19
20
|
(
|
|
@@ -35,20 +36,40 @@ export interface CreateElement {
|
|
|
35
36
|
): VNode
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
type NeverFallback<T, D> = [T] extends [never] ? D : T
|
|
40
|
+
|
|
41
|
+
export interface Vue<
|
|
42
|
+
Data = Record<string, any>,
|
|
43
|
+
Props = Record<string, any>,
|
|
44
|
+
Parent = never,
|
|
45
|
+
Root = never,
|
|
46
|
+
Children = never,
|
|
47
|
+
Options = never,
|
|
48
|
+
Emit = (event: string, ...args: any[]) => Vue
|
|
49
|
+
> {
|
|
50
|
+
// properties with different types in defineComponent()
|
|
51
|
+
readonly $data: Data
|
|
52
|
+
readonly $props: Props
|
|
53
|
+
readonly $parent: NeverFallback<Parent, Vue>
|
|
54
|
+
readonly $root: NeverFallback<Root, Vue>
|
|
55
|
+
readonly $children: NeverFallback<Children, Vue[]>
|
|
56
|
+
readonly $options: NeverFallback<Options, ComponentOptions<Vue>>
|
|
57
|
+
$emit: Emit
|
|
58
|
+
|
|
59
|
+
// Vue 2 only or shared
|
|
39
60
|
readonly $el: Element
|
|
40
|
-
readonly $options: ComponentOptions<Vue>
|
|
41
|
-
readonly $parent: Vue
|
|
42
|
-
readonly $root: Vue
|
|
43
|
-
readonly $children: Vue[]
|
|
44
61
|
readonly $refs: {
|
|
45
|
-
[key: string]:
|
|
62
|
+
[key: string]:
|
|
63
|
+
| Vue
|
|
64
|
+
| Element
|
|
65
|
+
| ComponentPublicInstance
|
|
66
|
+
| (Vue | Element | ComponentPublicInstance)[]
|
|
67
|
+
| undefined
|
|
46
68
|
}
|
|
47
69
|
readonly $slots: { [key: string]: VNode[] | undefined }
|
|
48
70
|
readonly $scopedSlots: { [key: string]: NormalizedScopedSlot | undefined }
|
|
49
71
|
readonly $isServer: boolean
|
|
50
|
-
|
|
51
|
-
readonly $props: Record<string, any>
|
|
72
|
+
|
|
52
73
|
readonly $ssrContext: any
|
|
53
74
|
readonly $vnode: VNode
|
|
54
75
|
readonly $attrs: Record<string, string>
|
|
@@ -72,9 +93,7 @@ export interface Vue {
|
|
|
72
93
|
$on(event: string | string[], callback: Function): this
|
|
73
94
|
$once(event: string | string[], callback: Function): this
|
|
74
95
|
$off(event?: string | string[], callback?: Function): this
|
|
75
|
-
$
|
|
76
|
-
$nextTick(callback: (this: this) => void): void
|
|
77
|
-
$nextTick(): Promise<void>
|
|
96
|
+
$nextTick: typeof nextTick
|
|
78
97
|
$createElement: CreateElement
|
|
79
98
|
}
|
|
80
99
|
|
|
@@ -313,6 +332,10 @@ export interface VueConstructor<V extends Vue = Vue> {
|
|
|
313
332
|
id: string,
|
|
314
333
|
definition?: ComponentOptions<V>
|
|
315
334
|
): ExtendedVue<V, {}, {}, {}, {}, {}>
|
|
335
|
+
component<T extends DefineComponent<any, any, any, any, any, any, any, any>>(
|
|
336
|
+
id: string,
|
|
337
|
+
definition?: T
|
|
338
|
+
): T
|
|
316
339
|
|
|
317
340
|
use<T>(
|
|
318
341
|
plugin: PluginObject<T> | PluginFunction<T>,
|