package @vue/shared
Enumerations
Name | Summary |
---|---|
Patch flags are optimization hints generated by the compiler. when a block with dynamicChildren is encountered during diff, the algorithm enters "optimized mode". In this mode, we know that the vdom is produced by a render function generated by the compiler, so the algorithm only needs to handle updates explicitly marked by these patch flags. Patch flags can be combined using the | bitwise operator and can be checked using the & operator, e.g. ```js const flag = TEXT |
|
CLASS
if (flag & TEXT) { … }
|
|
Functions
escapeHtml(string)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function escapeHtml(string: unknown): string;
escapeHtmlComment(src)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function escapeHtmlComment(src: string): string;
generateCodeFrame(source, start, end)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
Returns |
|
export declare function generateCodeFrame(source: string, start?: number, end?: number): string;
includeBooleanAttr(value)
Boolean attributes should be included if the value is truthy or ''. e.g. <select multiple> compiles to { multiple: '' }
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function includeBooleanAttr(value: unknown): boolean;
isSSRSafeAttrName(name)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function isSSRSafeAttrName(name: string): boolean;
looseEqual(a, b)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
Returns |
|
export declare function looseEqual(a: any, b: any): boolean;
looseIndexOf(arr, val)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
Returns |
|
export declare function looseIndexOf(arr: any[], val: any): number;
makeMap(str, expectsLowerCase)
Make a map and return a function for checking if a key is in that map. IMPORTANT: all calls of this function must be prefixed with /*\#\\_\\\_PURE\\\_\\\_\*/ So that rollup can tree-shake them if necessary.
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
Returns |
|
export declare function makeMap(str: string, expectsLowerCase?: boolean): (key: string) => boolean;
normalizeClass(value)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function normalizeClass(value: unknown): string;
normalizeProps(props)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function normalizeProps(props: Record<string, any> | null): Record<string, any> | null;
normalizeStyle(value)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
undefined |
export declare function normalizeStyle(value: unknown): NormalizedStyle | string | undefined;