We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本号 (version) @form-create/element-ui@3.1.11
问题描述 (Issue) 参考 #72 中的代码 return maker.input('商品价格', 'price', '100').children([maker.create('span').slot('append').children(['元'])]);
return maker.input('商品价格', 'price', '100').children([maker.create('span').slot('append').children(['元'])]);
上述代码在ts中会报类型错误:
不能将类型“Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>”分配给类型“string | RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>”。
复现步骤 文件:@form-create\core\types\index.d.ts第308行 问题: BaseCreateor.children()参数类型声明错误 children(prop: Array<RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | string>): this;
children(prop: Array<RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | string>): this;
// 为了简化描述, <OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> 泛型参数就不写了 export type RuleChildren = FormRule[] | RuleChildrenFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>; export type FormRule = Rule | Creator;
export type RuleChildren = FormRule[] | RuleChildrenFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
export type FormRule = Rule | Creator;
如果忽略泛型中的string类型, 最终children()函数的参数可以表述为: children(prop: Array<Creator[]>): this;
children(prop: Array<Creator[]>): this;
原因: children()需要的是一个 Array<Creator[]>, 而传递给它的是一个 Array
The text was updated successfully, but these errors were encountered:
感谢反馈,下个版本修复
Sorry, something went wrong.
最新版本已修复
No branches or pull requests
版本号 (version)
@form-create/element-ui@3.1.11
问题描述 (Issue)
参考 #72 中的代码
return maker.input('商品价格', 'price', '100').children([maker.create('span').slot('append').children(['元'])]);
上述代码在ts中会报类型错误:
复现步骤
文件:@form-create\core\types\index.d.ts第308行
问题: BaseCreateor.children()参数类型声明错误
children(prop: Array<RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | string>): this;
// 为了简化描述, <OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> 泛型参数就不写了
export type RuleChildren = FormRule[] | RuleChildrenFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
export type FormRule = Rule | Creator;
如果忽略泛型中的string类型, 最终children()函数的参数可以表述为:
children(prop: Array<Creator[]>): this;
原因: children()需要的是一个 Array<Creator[]>, 而传递给它的是一个 Array
The text was updated successfully, but these errors were encountered: