vue3-core/packages/runtime-vapor/src/apiCreateFor.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
633 B
TypeScript
Raw Normal View History

2024-12-11 11:50:17 +08:00
import type { EffectScope, ShallowRef } from '@vue/reactivity'
import type { Block, Fragment } from './block'
interface ForBlock extends Fragment {
scope: EffectScope
state: [
item: ShallowRef<any>,
key: ShallowRef<any>,
index: ShallowRef<number | undefined>,
]
key: any
}
type Source = any[] | Record<any, any> | number | Set<any> | Map<any, any>
export const createFor = (
src: () => Source,
renderItem: (block: ForBlock['state']) => Block,
getKey?: (item: any, key: any, index?: number) => any,
container?: ParentNode,
hydrationNode?: Node,
once?: boolean,
): Fragment => {
return [] as any
}