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

30 lines
817 B
TypeScript
Raw Normal View History

import {
createRenderer,
VNode,
RootRenderFunction,
CreateAppFunction
} from '@vue/runtime-core'
2019-09-06 20:58:32 +00:00
import { nodeOps, TestNode, 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'
2018-10-01 17:15:07 +00:00
const { render: baseRender, createApp: baseCreateApp } = createRenderer({
2019-06-20 13:28:37 +00:00
patchProp,
...nodeOps
2019-09-06 20:58:32 +00:00
})
2019-09-02 20:09:34 +00:00
export const render = baseRender as RootRenderFunction<TestNode, 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'