mirror of https://github.com/vuejs/core.git
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 Block = Node | Fragment | VaporComponentInstance | Block[]
|
||||||
|
|
||||||
export type BlockRenderFn = (...args: any[]) => Block
|
export type BlockFn = (...args: any[]) => Block
|
||||||
|
|
||||||
export class Fragment {
|
export class Fragment {
|
||||||
nodes: Block
|
nodes: Block
|
||||||
|
|
@ -30,7 +30,7 @@ export class DynamicFragment extends Fragment {
|
||||||
document.createTextNode('')
|
document.createTextNode('')
|
||||||
}
|
}
|
||||||
|
|
||||||
update(render?: BlockRenderFn, key: any = render): void {
|
update(render?: BlockFn, key: any = render): void {
|
||||||
if (key === this.key) return
|
if (key === this.key) return
|
||||||
this.key = key
|
this.key = key
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { EMPTY_OBJ, NO, hasOwn, isArray, isFunction } from '@vue/shared'
|
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 type { RawProps } from './componentProps'
|
||||||
import { currentInstance } from '@vue/runtime-core'
|
import { currentInstance } from '@vue/runtime-core'
|
||||||
import type { VaporComponentInstance } from './component'
|
import type { VaporComponentInstance } from './component'
|
||||||
|
|
@ -11,7 +11,7 @@ export type RawSlots = Record<string, Slot> & {
|
||||||
|
|
||||||
export type StaticSlots = 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 DynamicSlot = { name: string; fn: Slot }
|
||||||
export type DynamicSlotFn = () => DynamicSlot | DynamicSlot[]
|
export type DynamicSlotFn = () => DynamicSlot | DynamicSlot[]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue