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