vue3-yuanma/packages/runtime-test/src/index.ts

30 lines
839 B
TypeScript
Raw Normal View History

import {
createRenderer,
VNode,
RootRenderFunction,
CreateAppFunction
} from '@vue/runtime-core'
import { nodeOps, TestElement } from './nodeOps'
2019-06-20 13:28:37 +00:00
import { patchProp } from './patchProp'
2019-08-26 22:08:56 +00:00
import { serializeInner } from './serialize'
import { extend } from '@vue/shared'
2018-10-01 17:15:07 +00:00
const { render: baseRender, createApp: baseCreateApp } = createRenderer(
extend({ patchProp }, nodeOps)
)
2019-09-02 20:09:34 +00:00
export const render = baseRender as RootRenderFunction<TestElement>
export const createApp = baseCreateApp as CreateAppFunction<TestElement>
2019-08-26 22:08:56 +00:00
// convenience for one-off render validations
export function renderToString(vnode: VNode) {
const root = nodeOps.createElement('div')
render(vnode, root)
return serializeInner(root)
}
export * from './triggerEvent'
export * from './serialize'
2018-10-01 17:15:07 +00:00
export * from './nodeOps'
2018-10-26 19:44:50 +00:00
export * from '@vue/runtime-core'