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

758 B

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