From: Evan You Date: Fri, 1 Nov 2019 21:05:31 +0000 (-0400) Subject: fix: fix shapeflags export X-Git-Tag: v3.0.0-alpha.0~262 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5c501c0b43a523a0c8e68f892dd5a25595deab5;p=thirdparty%2Fvuejs%2Fcore.git fix: fix shapeflags export --- diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index d973a6defd..c51b1f2663 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -22,10 +22,11 @@ export { export { Text, Comment, Fragment, Portal, Suspense } from './vnode' // Internal Components export { KeepAlive } from './keepAlive' -// VNode patchFlags +// VNode flags +export { PublicShapeFlags as ShapeFlags } from './shapeFlags' import { PublicPatchFlags } from '@vue/shared' export const PatchFlags = PublicPatchFlags as { - // export flags as plain numbers to avoid d.ts relying on @vue/shared + // export patch flags as plain numbers to avoid d.ts relying on @vue/shared // the enum type is internal anyway. TEXT: number CLASS: number diff --git a/packages/runtime-core/src/shapeFlags.ts b/packages/runtime-core/src/shapeFlags.ts index 2ed5dcbdef..56c5d164a6 100644 --- a/packages/runtime-core/src/shapeFlags.ts +++ b/packages/runtime-core/src/shapeFlags.ts @@ -10,3 +10,15 @@ export const enum ShapeFlags { STATEFUL_COMPONENT_KEPT_ALIVE = 1 << 8, COMPONENT = ShapeFlags.STATEFUL_COMPONENT | ShapeFlags.FUNCTIONAL_COMPONENT } + +// For runtime consumption +export const PublicShapeFlags = { + ELEMENT: ShapeFlags.ELEMENT, + FUNCTIONAL_COMPONENT: ShapeFlags.FUNCTIONAL_COMPONENT, + STATEFUL_COMPONENT: ShapeFlags.STATEFUL_COMPONENT, + TEXT_CHILDREN: ShapeFlags.TEXT_CHILDREN, + ARRAY_CHILDREN: ShapeFlags.ARRAY_CHILDREN, + SLOTS_CHILDREN: ShapeFlags.SLOTS_CHILDREN, + SUSPENSE: ShapeFlags.SUSPENSE, + COMPONENT: ShapeFlags.COMPONENT +}