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/date-picker/demo/format.md

41 lines
758 B

7 years ago
<cn>
#### 日期格式
7 years ago
使用 `format` 属性,可以自定义日期显示格式。
</cn>
7 years ago
<us>
#### Date Format
7 years ago
We can set the date format by `format`.
</us>
7 years ago
```html
<template>
7 years ago
<div>
<a-date-picker :defaultValue="moment('2015/01/01', dateFormat)" :format="dateFormat" />
7 years ago
<br />
<a-month-picker :defaultValue="moment('2015/01', monthFormat)" :format="monthFormat" />
7 years ago
<br />
<a-range-picker
:defaultValue="[moment('2015/01/01', dateFormat), moment('2015/01/01', dateFormat)]"
:format="dateFormat"
7 years ago
/>
</div>
</template>
<script>
import moment from 'moment';
export default {
data(){
return {
dateFormat: 'YYYY/MM/DD',
monthFormat: 'YYYY/MM',
}
},
methods: {
moment,
}
}
</script>
```