| 21 | import * as runtimeDom from '@vue/runtime-dom' |
| 22 | |
| 23 | function wrappedCreateApp(...args: any[]) { |
| 24 | // @ts-expect-error |
| 25 | const app = createApp(...args) |
| 26 | if (compatUtils.isCompatEnabled(DeprecationTypes.RENDER_FUNCTION, null)) { |
| 27 | // register built-in components so that they can be resolved via strings |
| 28 | // in the legacy h() call. The __compat__ prefix is to ensure that v3 h() |
| 29 | // doesn't get affected. |
| 30 | app.component('__compat__transition', Transition) |
| 31 | app.component('__compat__transition-group', TransitionGroup) |
| 32 | app.component('__compat__keep-alive', KeepAlive) |
| 33 | // built-in directives. No need for prefix since there's no render fn API |
| 34 | // for resolving directives via string in v3. |
| 35 | app._context.directives.show = vShow |
| 36 | app._context.directives.model = vModelDynamic |
| 37 | } |
| 38 | return app |
| 39 | } |
| 40 | |
| 41 | export function createCompatVue(): CompatVue { |
| 42 | const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp) |