formData的声明
This commit is contained in:
parent
ac950bf0fb
commit
6f3b706427
|
|
@ -201,11 +201,14 @@ export function makeCommonComponentMethods<
|
|||
this.setState(data);
|
||||
}
|
||||
else {
|
||||
/**
|
||||
* 这里的data属性为undefined,但声明不太好写,很难精准的判断这种情况
|
||||
* 即使oakpage的entity属性为空也不行,有可能动态传入
|
||||
*/
|
||||
const data: Record<string, any> = formData ? await formData.call(this, {
|
||||
data: undefined,
|
||||
features,
|
||||
props: this.props,
|
||||
}) : {};
|
||||
} as any) : {};
|
||||
if (extra) {
|
||||
assign(data, extra);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ interface ComponentOption<
|
|||
entity?: T;
|
||||
isList: IsList;
|
||||
formData?: (options: {
|
||||
data?: IsList extends true ? RowSelected<ED, T>[] : RowSelected<ED, T>;
|
||||
data: IsList extends true ? RowSelected<ED, T>[] : RowSelected<ED, T>;
|
||||
features: BasicFeatures<ED, Cxt, AD & CommonAspectDict<ED, Cxt>> & FD;
|
||||
props: Partial<WechatMiniprogram.Component.PropertyOptionToData<TProperty>>;
|
||||
legalActions?: string[],
|
||||
|
|
@ -74,7 +74,7 @@ interface PageOption<
|
|||
}>;
|
||||
actions?: ED[T]['Action'][];
|
||||
formData?: (options: {
|
||||
data?: IsList extends true ? RowSelected<ED, T, Proj>[] : RowSelected<ED, T, Proj>;
|
||||
data: IsList extends true ? RowSelected<ED, T, Proj>[] : RowSelected<ED, T, Proj>;
|
||||
features: BasicFeatures<ED, Cxt, AD & CommonAspectDict<ED, Cxt>> & FD;
|
||||
props: Partial<WechatMiniprogram.Component.PropertyOptionToData<TProperty>>;
|
||||
legalActions?: string[],
|
||||
|
|
|
|||
Loading…
Reference in New Issue