refactor: rename vnode hooks
So that they can be used as @vnodeMounted="..." in templates
This commit is contained in:
@@ -52,9 +52,8 @@ export const toTypeString = (value: unknown): string =>
|
||||
export const isPlainObject = (val: any): val is object =>
|
||||
toTypeString(val) === '[object Object]'
|
||||
|
||||
const vnodeHooksRE = /^vnode/
|
||||
export const isReservedProp = (key: string): boolean =>
|
||||
key === 'key' || key === 'ref' || key === '$once' || vnodeHooksRE.test(key)
|
||||
key === 'key' || key === 'ref' || key === '$once' || key.startsWith(`onVnode`)
|
||||
|
||||
const camelizeRE = /-(\w)/g
|
||||
export const camelize = (str: string): string => {
|
||||
|
||||
@@ -41,8 +41,8 @@ export const enum PatchFlags {
|
||||
FULL_PROPS = 1 << 4,
|
||||
|
||||
// Indicates an element that only needs non-props patching, e.g. ref or
|
||||
// directives (vnodeXXX hooks). It simply marks the vnode as "need patch",
|
||||
// since every patched vnode checks for refs and vnodeXXX hooks.
|
||||
// directives (onVnodeXXX hooks). It simply marks the vnode as "need patch",
|
||||
// since every patched vnode checks for refs and onVnodeXXX hooks.
|
||||
// This flag is never directly matched against, it simply serves as a non-zero
|
||||
// value.
|
||||
NEED_PATCH = 1 << 5,
|
||||
|
||||
Reference in New Issue
Block a user