Schedule
Demos
9:00–12:00 | 13:00–18:00 | ||||||||||||||||||||||
13:00–17:00 | |||||||||||||||||||||||
Entire day |
<template>
<article>
<veui-schedule
v-model="selected"
:shortcuts="shortcuts"
shortcuts-display="popup"
:statuses="statuses"
/>
</article>
</template>
<script>
import { Schedule } from 'veui'
export default {
components: {
'veui-schedule': Schedule
},
data () {
return {
selected: {
0: [[0, 23]],
1: [[9, 11], [13, 17]],
3: [[13, 16]],
5: [[9, 9], [16, 17]]
},
shortcuts: [
{
label: 'Entire week',
selected: {
0: true,
1: true,
2: true,
3: true,
4: true,
5: true,
6: true
}
},
{
label: 'Weekdays',
selected: {
1: true,
2: true,
3: true,
4: true,
5: true
}
},
{
label: 'Weekends',
selected: {
0: true,
6: true
}
}
],
statuses: [
{
label: 'Selected',
name: 'selected'
},
{
label: 'Available',
name: 'available'
}
]
}
}
}
</script>
API
Props
Name | Type | Default | Description |
---|---|---|---|
selected | Object | - |
Selected time ranges. The data type is The keys denote day of week, corresponding to the return value of
This sample stands for 9:00–18:00 of Monday and 0:00–3:00 & 18:00–21:00 of Saturday. The end hour denotes the start point of the last hour in the time range. |
hour-class | string|Array|Object|function | {} | The customized HTML class for the hour cell. When not being a function, supports all values defined by Vue's class expressions. If it's a function, the signature is function(day: number, hour: number): string|Array<string>|Object<string, boolean> . The return value is also a Vue class expression. |
disabled-date | function(number, number): boolean | () => false | Whether the hour cell is disabled. Parameter list is (day: number, hour: number) . day and hour denote the day of week and the hour respectively. Return value specifies whether the hour cell is disabled from selection. |
shortcuts | Array | schedule.shortcuts | Shortcut selection list. The type is
|
shortcuts-display | string | 'inline' | The display mode of the shortcuts. Supported values are inline /popup , which denote inline button groups and dropdown select, respectively. |
statuses | Array<{label: string, value: string}> | schedule.statuses | The datasource of the legends. Legend items will have a class value of `veui-schedule-legend-${value}` and the label property will be the text label of each status. |
disabled | boolean | false | Whether the schedule component is disabled. |
readonly | boolean | false | Whether the schedule component is read-only. |
Slots
Name | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
header | The entire header section. | |||||||||
header-content | The content of the header section, not including the container. | |||||||||
shortcuts | The shortcuts section of the header section. | |||||||||
legend | The legends section of the header section. | |||||||||
legend-label | The text label of each legend. Displays the
Additionally, custom properties inside | |||||||||
hour | The content of each hour cell.
| |||||||||
label | The content of the selected label. By default, displays the time range in the form of
| |||||||||
tooltip | The tooltip for each hour cell. Displays
|
Events
Name | Description |
---|---|
select |
Triggered when selection changed. The callback parameter list is |
Global config
Key | Type | Default | Description |
---|---|---|---|
schedule.statuses | Array<{name, label}> | See description. | The default status list with item type being
|