vue3-core/packages/runtime-core/README.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
657 B
Markdown
Raw Normal View History

2018-10-27 03:44:50 +08:00
# @vue/runtime-core
2018-09-19 23:35:38 +08:00
> This package is published only for typing and building custom renderers. It is NOT meant to be used in applications.
2018-09-20 12:17:20 +08:00
For full exposed APIs, see `src/index.ts`.
2019-09-07 00:58:31 +08:00
## Building a Custom Renderer
```ts
2019-12-10 03:03:10 +08:00
import { createRenderer } from '@vue/runtime-core'
2018-09-20 12:17:20 +08:00
2019-09-07 04:58:32 +08:00
const { render, createApp } = createRenderer({
2019-10-21 22:04:34 +08:00
patchProp,
2019-09-07 00:58:31 +08:00
insert,
remove,
createElement,
2019-09-07 00:58:31 +08:00
// ...
2018-09-20 12:17:20 +08:00
})
2019-09-07 04:58:32 +08:00
// `render` is the low-level API
// `createApp` returns an app instance with configurable context shared
// by the entire app tree.
export { render, createApp }
2019-09-07 00:58:31 +08:00
export * from '@vue/runtime-core'
2018-09-20 12:17:20 +08:00
```
2019-09-07 00:58:31 +08:00
See `@vue/runtime-dom` for how a DOM-targeting renderer is implemented.