wip: update test runtime
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { createRenderer, VNode } from '@vue/runtime-core'
|
||||
import { DOMRendererOptions } from './rendererOptions'
|
||||
import { nodeOps } from './nodeOps'
|
||||
import { patchProp } from './patchProp'
|
||||
|
||||
export const render = createRenderer(DOMRendererOptions) as (
|
||||
vnode: VNode | null,
|
||||
container: HTMLElement
|
||||
) => VNode
|
||||
export const render = createRenderer({
|
||||
patchProp,
|
||||
...nodeOps
|
||||
}) as (vnode: VNode | null, container: HTMLElement) => VNode
|
||||
|
||||
// re-export everything from core
|
||||
// h, Component, observer API, nextTick, flags & types
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import { RendererOptions } from '@vue/runtime-core'
|
||||
import { patchProp } from './patchProp'
|
||||
|
||||
const doc = document
|
||||
const svgNS = 'http://www.w3.org/2000/svg'
|
||||
|
||||
export const DOMRendererOptions: RendererOptions = {
|
||||
patchProp,
|
||||
|
||||
export const nodeOps = {
|
||||
insert: (child: Node, parent: Node, anchor?: Node) => {
|
||||
if (anchor != null) {
|
||||
parent.insertBefore(child, anchor)
|
||||
@@ -16,7 +11,6 @@ export const DOMRendererOptions: RendererOptions = {
|
||||
},
|
||||
|
||||
remove: (child: Node) => {
|
||||
if (!child) debugger
|
||||
const parent = child.parentNode
|
||||
if (parent != null) {
|
||||
parent.removeChild(child)
|
||||
Reference in New Issue
Block a user