refactor: use const enums for flags
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ComponentInstance } from './component'
|
||||
import { VNode, NormalizedChildren, normalizeVNode, VNodeChild } from './vnode'
|
||||
import { isArray, isFunction } from '@vue/shared'
|
||||
import { SLOTS_CHILDREN } from './typeFlags'
|
||||
import { ShapeFlags } from './shapeFlags'
|
||||
|
||||
export type Slot = (...args: any[]) => VNode[]
|
||||
export type Slots = Readonly<{
|
||||
@@ -24,7 +24,7 @@ export function resolveSlots(
|
||||
children: NormalizedChildren
|
||||
) {
|
||||
let slots: Slots | void
|
||||
if (instance.vnode.shapeFlag & SLOTS_CHILDREN) {
|
||||
if (instance.vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) {
|
||||
if ((children as any)._normalized) {
|
||||
// pre-normalized slots object generated by compiler
|
||||
slots = children as Slots
|
||||
|
||||
Reference in New Issue
Block a user