wip: props default this compat
This commit is contained in:
@@ -33,6 +33,7 @@ import {
|
||||
import { isEmitListener } from './componentEmits'
|
||||
import { InternalObjectKey } from './vnode'
|
||||
import { AppContext } from './apiCreateApp'
|
||||
import { createPropsDefaultThis } from './compat/props'
|
||||
|
||||
export type ComponentPropsOptions<P = Data> =
|
||||
| ComponentObjectPropsOptions<P>
|
||||
@@ -342,7 +343,10 @@ function resolvePropValue(
|
||||
value = propsDefaults[key]
|
||||
} else {
|
||||
setCurrentInstance(instance)
|
||||
value = propsDefaults[key] = defaultValue(props)
|
||||
value = propsDefaults[key] =
|
||||
__COMPAT__ && __DEV__
|
||||
? defaultValue.call(createPropsDefaultThis(key), props)
|
||||
: defaultValue(props)
|
||||
setCurrentInstance(null)
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user