-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DatePicker): datepicker support multiple api (#3199)
* feat(datepicker): support multiple api * chore(datepicker): adjustment props multiple * chore(datepicker): update onRemove and onClear methods * chore(datepicker): code clean * chore(datepicker): code clean * fix: fix type * fix: fix type * chore: update common * chore: update snapshot * chore: revert api change * chore: revert api change * chore: docs update * chore: type * chore: code clean --------- Co-authored-by: Uyarn <[email protected]>
- Loading branch information
1 parent
533f124
commit e241722
Showing
20 changed files
with
308 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { useState } from 'react'; | ||
import { DatePicker } from 'tdesign-react'; | ||
import type { DatePickerProps, DateMultipleValue } from 'tdesign-react'; | ||
|
||
export default function YearDatePicker() { | ||
const [defaultValue, setDefaultValue] = useState<DateMultipleValue>(['2000-01-04', '2000-01-03', '2000-01-05']); | ||
|
||
const handleChange: DatePickerProps['onChange'] = (value: DateMultipleValue, context) => { | ||
console.log('onChange:', value, context); | ||
setDefaultValue(value); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<DatePicker | ||
value={defaultValue} | ||
placeholder="可清除、可输入的日期选择器" | ||
onChange={handleChange} | ||
clearable | ||
multiple | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.