]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: fix shapeflags export
authorEvan You <yyx990803@gmail.com>
Fri, 1 Nov 2019 21:05:31 +0000 (17:05 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 1 Nov 2019 21:05:38 +0000 (17:05 -0400)
packages/runtime-core/src/index.ts
packages/runtime-core/src/shapeFlags.ts

index d973a6defd07f03a4fb64fbcb15919430efc21f2..c51b1f2663788016b4231147e575401a44a8e093 100644 (file)
@@ -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
index 2ed5dcbdef289574f6a19ff4fa97579ea90622b4..56c5d164a6a8794366b1ebd1fd2608c8b1ca159d 100644 (file)
@@ -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
+}