chore: no longer need to wrap legacy render fn
This commit is contained in:
parent
a0321b39b7
commit
70947771dc
@ -167,7 +167,6 @@ export function shouldUpdateFunctionalComponent(
|
|||||||
return shouldUpdate
|
return shouldUpdate
|
||||||
}
|
}
|
||||||
|
|
||||||
// compat only
|
|
||||||
export function createComponentClassFromOptions(
|
export function createComponentClassFromOptions(
|
||||||
options: ComponentOptions
|
options: ComponentOptions
|
||||||
): ComponentClass {
|
): ComponentClass {
|
||||||
@ -180,13 +179,7 @@ export function createComponentClassFromOptions(
|
|||||||
for (const key in options) {
|
for (const key in options) {
|
||||||
const value = options[key]
|
const value = options[key]
|
||||||
if (typeof value === 'function') {
|
if (typeof value === 'function') {
|
||||||
;(ObjectComponent.prototype as any)[key] =
|
;(ObjectComponent.prototype as any)[key] = value
|
||||||
key === 'render'
|
|
||||||
? // normalize render for legacy signature
|
|
||||||
function render() {
|
|
||||||
return value.call(this, h)
|
|
||||||
}
|
|
||||||
: value
|
|
||||||
}
|
}
|
||||||
if (key === 'computed') {
|
if (key === 'computed') {
|
||||||
const isGet = typeof value === 'function'
|
const isGet = typeof value === 'function'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user