chore: BlockFn
This commit is contained in:
parent
aa96762ad4
commit
407b9abc0b
|
@ -5,7 +5,7 @@ import { EffectScope } from '@vue/reactivity'
|
|||
|
||||
export type Block = Node | Fragment | VaporComponentInstance | Block[]
|
||||
|
||||
export type BlockRenderFn = (...args: any[]) => Block
|
||||
export type BlockFn = (...args: any[]) => Block
|
||||
|
||||
export class Fragment {
|
||||
nodes: Block
|
||||
|
@ -30,7 +30,7 @@ export class DynamicFragment extends Fragment {
|
|||
document.createTextNode('')
|
||||
}
|
||||
|
||||
update(render?: BlockRenderFn, key: any = render): void {
|
||||
update(render?: BlockFn, key: any = render): void {
|
||||
if (key === this.key) return
|
||||
this.key = key
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { EMPTY_OBJ, NO, hasOwn, isArray, isFunction } from '@vue/shared'
|
||||
import { type Block, type BlockRenderFn, DynamicFragment } from './block'
|
||||
import { type Block, type BlockFn, DynamicFragment } from './block'
|
||||
import type { RawProps } from './componentProps'
|
||||
import { currentInstance } from '@vue/runtime-core'
|
||||
import type { VaporComponentInstance } from './component'
|
||||
|
@ -11,7 +11,7 @@ export type RawSlots = Record<string, Slot> & {
|
|||
|
||||
export type StaticSlots = Record<string, Slot>
|
||||
|
||||
export type Slot = BlockRenderFn
|
||||
export type Slot = BlockFn
|
||||
export type DynamicSlot = { name: string; fn: Slot }
|
||||
export type DynamicSlotFn = () => DynamicSlot | DynamicSlot[]
|
||||
|
||||
|
|
Loading…
Reference in New Issue