Closed 1353823765 closed 3 weeks ago
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
本地开发问题,打包编译出错显示useControlModel这个方法的类型声明问题,打包显示 [17:53:27] Type error: Type parameter declaration expected. [17:53:27] [17:53:27] 22 | }[]> = T[number]['name']; [17:53:27] 23 | export declare function useControlModel({ value, onChange, id }: WithControlPropsType, model?: T): ControlModelType; [17:53:27] > 24 | export declare function useControlModel<const T extends readonly string[]>({ value, onChange, id }: WithControlPropsType, model?: T): { [17:53:27] | ^
[17:53:27] 26 | }; [17:53:27] 27 | export declare function useControlModel<const T extends readonly FormControlMultiProps[]>({ value, onChange, id }: WithControlPropsType, model?: T): {
当前 Issue 未检测到标题,请规范填写,谢谢!
The title of the current issue is not detected, please fill in according to the specifications, thank you!
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
本地开发问题,打包编译出错显示useControlModel这个方法的类型声明问题,打包显示 [17:53:27] Type error: Type parameter declaration expected. [17:53:27] [17:53:27] 22 | }[]> = T[number]['name']; [17:53:27] 23 | export declare function useControlModel({ value, onChange, id }: WithControlPropsType, model?: T): ControlModelType;
[17:53:27] > 24 | export declare function useControlModel<const T extends readonly string[]>({ value, onChange, id }: WithControlPropsType, model?: T): {
[17:53:27] | ^
[17:53:27] 26 | }; [17:53:27] 27 | export declare function useControlModel<const T extends readonly FormControlMultiProps[]>({ value, onChange, id }: WithControlPropsType, model?: T): {
📷 复现步骤
🏞 期望结果
💻 复现代码
© 版本信息
🚑 其他信息