You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/calendar/demo/select.md

45 lines
1.0 KiB

7 years ago
<cn>
#### 选择功能
7 years ago
一个通用的日历面板,支持年/月切换。
7 years ago
</cn>
7 years ago
7 years ago
<us>
#### Selectable Calendar
7 years ago
A basic calendar component with Year/Month switch.
7 years ago
</us>
7 years ago
7 years ago
```html
<template>
<div>
<a-alert :message="`You selected date: ${selectedValue && selectedValue.format('YYYY-MM-DD')}`" />
<div :style="{ display: 'inline-block', width: '500px', border: '1px solid #d9d9d9', borderRadius: '4px' }">
<a-calendar :value="value" @select="onSelect" @panelChange="onPanelChange" />
</div>
<div :style="{ display: 'inline-block', width: '500px',marginLeft: '20px', border: '1px solid #d9d9d9', borderRadius: '4px' }">
<a-calendar v-model="value" />
</div>
</div>
</template>
<script>
7 years ago
import moment from 'moment';
7 years ago
export default {
data() {
return {
value: moment('2017-01-25'),
selectedValue: moment('2017-01-25'),
}
},
methods: {
onSelect(value) {
this.value = value
this.selectedValue = value
},
onPanelChange (value) {
this.value = value
}
7 years ago
}
}
7 years ago
</script>
```
7 years ago