-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
问题同The type definition of the ranges property of the RangePicker component is incorrect #4159 ,附可复现demo
Version
2.2.6
Environment
win10, vue3
Reproduction link
https://github.com/Fallsleep/ant-design-vue-test
Steps to reproduce
git clone git@github.com:Fallsleep/ant-design-vue-test.git
yarn
yarn dev
yarn build
What is expected?
a-range-picker组件的value属性的typescript类型可以和Moment匹配。
What is actually happening?
目前a-range-picker组件的value属性的typescript类型和Moment的类型无法匹配,开发时能正常访问,VSCode会提示ts(2322)类型不匹配的错误,但是执行vue-tsc --noEmit && vite build进行编译时就这个错误就无法通过了,错误信息如下:
yarn build
yarn run v1.22.4
warning package.json: No license field
$ vue-tsc --noEmit && vite build
src/App.vue(4,15): error TS2322: Type '{ format: (format?: string | undefined) => string; startOf: (unitOfTime: StartOf) => Moment; endOf: (unitOfTime: StartOf) => Moment; add: { (amount?: DurationInputArg1, unit?: DurationConstructor | undefined): Moment; (unit: DurationConstructor, amount: string | number): Moment; }; ... 84 more ...; propertyIsEnumera...' is not assignable to type 'RangePickerValue | undefined'.
Type '{ format: (format?: string | undefined) => string; startOf: (unitOfTime: StartOf) => Moment; endOf: (unitOfTime: StartOf) => Moment; add: { (amount?: DurationInputArg1, unit?: DurationConstructor | undefined): Moment; (unit: DurationConstructor, amount: string | number): Moment; }; ... 84 more ...; propertyIsEnumera...' is not assignable to type 'undefined[]'.
Type '{ format: (format?: string | undefined) => string; startOf: (unitOfTime: StartOf) => Moment; endOf: (unitOfTime: StartOf) => Moment; add: { (amount?: DurationInputArg1, unit?: DurationConstructor | undefined): Moment; (unit: DurationConstructor, amount: string | number): Moment; }; ... 84 more ...; propertyIsEnumera...' is not assignable to type 'undefined'.
error Command failed with exit code 2.