mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
[improvement] optimize sfc type definitions (#2778)
This commit is contained in:
@@ -13,13 +13,16 @@ import Vue, {
|
||||
import { VNode } from 'vue/types/vnode';
|
||||
import { InjectOptions, PropsDefinition } from 'vue/types/options';
|
||||
|
||||
export type ScopedSlot = (props?: any) => VNode[] | undefined;
|
||||
export type ScopedSlot<Props = any> = (props?: Props) => VNode[] | undefined;
|
||||
|
||||
export type ScopedSlots = {
|
||||
[key: string]: ScopedSlot | undefined;
|
||||
export type DefaultSlots = {
|
||||
default?: ScopedSlot;
|
||||
};
|
||||
|
||||
export type ScopedSlots = DefaultSlots & {
|
||||
[key: string]: ScopedSlot | undefined;
|
||||
};
|
||||
|
||||
export type ModelOptions = {
|
||||
prop?: string;
|
||||
event?: string;
|
||||
@@ -50,7 +53,7 @@ export type FunctionalComponent<
|
||||
export type TsxBaseProps = {
|
||||
class?: any;
|
||||
style?: any;
|
||||
}
|
||||
};
|
||||
export type TsxComponent<T> = (props: T & TsxBaseProps) => VNode;
|
||||
|
||||
const arrayProp = {
|
||||
@@ -102,7 +105,8 @@ function transformFunctionalComponent(
|
||||
functional: true,
|
||||
props: pure.props,
|
||||
model: pure.model,
|
||||
render: (h, context): any => pure(h, context.props, unifySlots(context), context)
|
||||
render: (h, context): any =>
|
||||
pure(h, context.props, unifySlots(context), context)
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user