-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
Codecov Report
@@ Coverage Diff @@
## master #49 +/- ##
=========================================
Coverage ? 87.21%
=========================================
Files ? 15
Lines ? 446
Branches ? 109
=========================================
Hits ? 389
Misses ? 56
Partials ? 1
Continue to review full report at Codecov.
|
Deploy preview for wizard-ui ready! Built with commit ed93306 |
…icker * 'master' of github.com:xsky-fe/wizard-ui: feat: Add Dropdown component. (#47) # Conflicts: # src/interface.tsx
src/components/DatePicker/index.tsx
Outdated
import { DatePickerProps } from '../../interface'; | ||
import './style.scss'; | ||
|
||
const format: string = 'YYYY-MM-DD HH:mm:ss'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果右边的 value 可以直接推断出类型,左侧可以不用指定
src/components/DatePicker/index.tsx
Outdated
|
||
const format: string = 'YYYY-MM-DD HH:mm:ss'; | ||
|
||
function getFormat(time: boolean | undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参数可以使用 time?: boolean 代替
src/components/DatePicker/index.tsx
Outdated
getTime: PropTypes.func, | ||
}; | ||
|
||
DatePicker.defaultProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以把 defaultProps 类型单独定义出来,在这里显式指定,避免属性拼写或其他错误
src/components/DatePicker/index.tsx
Outdated
}; | ||
|
||
DatePicker.defaultProps = { | ||
disabled: false, | ||
showTime: true, | ||
}; | ||
} as DatePickerDefaultProps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as 就做不到检查了,可以先定义 defaultProps 再赋值
const defaultProps: DatePickerDefaultProps = {
...
}
DatePicker.defaultProps = defaultProps;
No description provided.