2021-09-17 00:18:50 +08:00
|
|
|
<template>
|
|
|
|
<div class="demo-date-picker">
|
|
|
|
<div class="container">
|
|
|
|
<div class="block">
|
|
|
|
<span class="demonstration">Week</span>
|
|
|
|
<el-date-picker
|
|
|
|
v-model="value1"
|
|
|
|
type="week"
|
|
|
|
format="[Week] ww"
|
|
|
|
placeholder="Pick a week"
|
2022-03-14 04:16:11 +08:00
|
|
|
/>
|
2021-09-17 00:18:50 +08:00
|
|
|
</div>
|
|
|
|
<div class="block">
|
|
|
|
<span class="demonstration">Month</span>
|
|
|
|
<el-date-picker
|
|
|
|
v-model="value2"
|
|
|
|
type="month"
|
|
|
|
placeholder="Pick a month"
|
2022-03-14 04:16:11 +08:00
|
|
|
/>
|
2021-09-17 00:18:50 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
<div class="block">
|
|
|
|
<span class="demonstration">Year</span>
|
2022-03-14 04:16:11 +08:00
|
|
|
<el-date-picker
|
|
|
|
v-model="value3"
|
|
|
|
type="year"
|
|
|
|
placeholder="Pick a year"
|
|
|
|
/>
|
2021-09-17 00:18:50 +08:00
|
|
|
</div>
|
|
|
|
<div class="block">
|
|
|
|
<span class="demonstration">Dates</span>
|
|
|
|
<el-date-picker
|
|
|
|
v-model="value4"
|
|
|
|
type="dates"
|
|
|
|
placeholder="Pick one or more dates"
|
2022-03-14 04:16:11 +08:00
|
|
|
/>
|
2021-09-17 00:18:50 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
2021-12-21 15:51:33 +08:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { ref } from 'vue'
|
2021-09-17 00:18:50 +08:00
|
|
|
|
2021-12-21 15:51:33 +08:00
|
|
|
const value1 = ref('')
|
|
|
|
const value2 = ref('')
|
|
|
|
const value3 = ref('')
|
|
|
|
const value4 = ref('')
|
2021-09-17 00:18:50 +08:00
|
|
|
</script>
|
2022-01-31 23:43:56 +08:00
|
|
|
<style scoped>
|
|
|
|
.demo-date-picker {
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
padding: 0;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.demo-date-picker .block {
|
|
|
|
padding: 30px 0;
|
|
|
|
text-align: center;
|
2022-03-13 20:10:07 +08:00
|
|
|
border-right: solid 1px getCssVar('border-color');
|
2022-01-31 23:43:56 +08:00
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
.demo-date-picker .block:last-child {
|
|
|
|
border-right: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.demo-date-picker .container {
|
|
|
|
flex: 1;
|
2022-03-13 20:10:07 +08:00
|
|
|
border-right: solid 1px getCssVar('border-color');
|
2022-01-31 23:43:56 +08:00
|
|
|
}
|
|
|
|
.demo-date-picker .container .block {
|
|
|
|
border-right: none;
|
|
|
|
}
|
|
|
|
.demo-date-picker .container .block:last-child {
|
2022-03-13 20:10:07 +08:00
|
|
|
border-top: solid 1px getCssVar('border-color');
|
2022-01-31 23:43:56 +08:00
|
|
|
}
|
|
|
|
.demo-date-picker .container:last-child {
|
|
|
|
border-right: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.demo-date-picker .demonstration {
|
|
|
|
display: block;
|
|
|
|
color: var(--el-text-color-secondary);
|
|
|
|
font-size: 14px;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
</style>
|