MCPcopy
hub / github.com/vuejs/core / mountWithHydration

Function mountWithHydration

packages/runtime-core/__tests__/hydration.spec.ts:43–55  ·  view source on GitHub ↗
(html: string, render: () => any)

Source from the content-addressed store, hash-verified

41const { createRecord, reload } = __VUE_HMR_RUNTIME__
42
43function mountWithHydration(html: string, render: () => any) {
44 const container = document.createElement('div')
45 container.innerHTML = html
46 const app = createSSRApp({
47 render,
48 })
49 return {
50 vnode: app.mount(container).$.subTree as VNode<Node, Element> & {
51 el: Element
52 },
53 container,
54 }
55}
56
57const triggerEvent = (type: string, el: Element) => {
58 const event = new Event(type)

Callers 1

hydration.spec.tsFile · 0.85

Calls 2

createElementMethod · 0.80
mountMethod · 0.80

Tested by

no test coverage detected