fix(runtime-core): respect props from mixins and extends

fix #1236, close #1250
This commit is contained in:
Evan You
2020-06-09 11:27:40 -04:00
parent dc986addd9
commit 2417a0cb30
5 changed files with 95 additions and 40 deletions

View File

@@ -15,7 +15,11 @@ import {
exposePropsOnRenderContext,
exposeSetupStateOnRenderContext
} from './componentProxy'
import { ComponentPropsOptions, initProps } from './componentProps'
import {
ComponentPropsOptions,
NormalizedPropsOptions,
initProps
} from './componentProps'
import { Slots, initSlots, InternalSlots } from './componentSlots'
import { warn } from './warning'
import { ErrorCodes, callWithErrorHandling } from './errorHandling'
@@ -50,7 +54,11 @@ export type Data = { [key: string]: unknown }
// Note: can't mark this whole interface internal because some public interfaces
// extend it.
export interface SFCInternalOptions {
export interface ComponentInternalOptions {
/**
* @internal
*/
__props?: NormalizedPropsOptions | []
/**
* @internal
*/
@@ -76,7 +84,7 @@ export interface SFCInternalOptions {
export interface FunctionalComponent<
P = {},
E extends EmitsOptions = Record<string, any>
> extends SFCInternalOptions {
> extends ComponentInternalOptions {
// use of any here is intentional so it can be a valid JSX Element constructor
(props: P, ctx: SetupContext<E>): any
props?: ComponentPropsOptions<P>