-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Datepicker): support multiple select
- Loading branch information
Showing
8 changed files
with
26 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,9 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-date-picker v-model="date2" @change="handleChange" /> | ||
<t-date-picker | ||
v-model="date" | ||
placeholder="可清除、可输入的日期选择器" | ||
clearable | ||
allow-input | ||
@change="handleChange" | ||
/> | ||
<t-date-picker multiple /> | ||
<t-date-picker mode="week" multiple /> | ||
<t-date-picker mode="year" multiple /> | ||
</t-space> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { Dayjs } from 'dayjs'; | ||
import { ref } from 'vue'; | ||
import { DateValue, DatePickerTriggerSource } from 'tdesign-vue-next'; | ||
const date = ref(''); | ||
const date2 = ref(''); | ||
function handleChange( | ||
value: DateValue, | ||
context: { | ||
dayjsValue?: Dayjs; | ||
trigger?: DatePickerTriggerSource; | ||
}, | ||
) { | ||
console.log('onChange:', value, context); | ||
console.log('timestamp:', context.dayjsValue.valueOf()); | ||
console.log('YYYYMMDD:', context.dayjsValue.format('YYYYMMDD')); | ||
} | ||
</script> | ||
<script setup></script> |
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 |
---|---|---|
@@ -1,25 +1,9 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-date-picker v-model="date2" @change="handleChange" /> | ||
<t-date-picker | ||
v-model="date" | ||
placeholder="可清除、可输入的日期选择器" | ||
clearable | ||
allow-input | ||
@change="handleChange" | ||
/> | ||
<t-date-picker multiple /> | ||
<t-date-picker mode="week" multiple /> | ||
<t-date-picker mode="year" multiple /> | ||
</t-space> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const date = ref(''); | ||
const date2 = ref(''); | ||
function handleChange(value, context) { | ||
console.log('onChange:', value, context); | ||
console.log('timestamp:', context.dayjsValue.valueOf()); | ||
console.log('YYYYMMDD:', context.dayjsValue.format('YYYYMMDD')); | ||
} | ||
</script> | ||
<script setup></script> |
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
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