Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 11x 11x 11x 9x 9x 3x 3x 6x 6x 6x 6x 9x 9x 9x 2x 7x 9x | import { ComponentInternalInstance, ssrContextKey } from 'vue' import { createBuffer, PushFn, SSRBufferItem, SSRContext } from '../render' export function ssrRenderTeleport( parentPush: PushFn, contentRenderFn: (push: PushFn) => void, target: string, disabled: boolean, parentComponent: ComponentInternalInstance ) { parentPush('<!--teleport start-->') let teleportContent: SSRBufferItem if (disabled) { contentRenderFn(parentPush) teleportContent = `<!---->` } else { const { getBuffer, push } = createBuffer() contentRenderFn(push) push(`<!---->`) // teleport end anchor teleportContent = getBuffer() } const context = parentComponent.appContext.provides[ ssrContextKey as any ] as SSRContext const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {}) if (teleportBuffers[target]) { teleportBuffers[target].push(teleportContent) } else { teleportBuffers[target] = [teleportContent] } parentPush('<!--teleport end-->') } |