wip: async component compat

This commit is contained in:
Evan You
2021-04-08 16:11:28 -04:00
parent d7957a7440
commit 18cf63ff05
3 changed files with 127 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ import { RendererNode, RendererElement } from './renderer'
import { NULL_DYNAMIC_COMPONENT } from './helpers/resolveAssets'
import { hmrDirtyComponents } from './hmr'
import { setCompiledSlotRendering } from './helpers/renderSlot'
import { convertLegacyComponent } from './compat/component'
export const Fragment = (Symbol(__DEV__ ? 'Fragment' : undefined) as any) as {
__isFragment: true
@@ -358,6 +359,11 @@ function _createVNode(
type = type.__vccOpts
}
// 2.x async/functional component compat
if (__COMPAT__) {
type = convertLegacyComponent(type)
}
// class & style normalization.
if (props) {
// for reactive or proxy objects, we need to clone it to enable mutation.