Skip to content

DatePicker 的mode 属性设置为 year 或 month 时change事件没有响应,disabledDate函数也没有响应 #2249

@chensimin09

Description

@chensimin09
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.4.12

Environment

vue

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Current ant-design-vue version: {{ version }}
You can change ant-design-vue version on the left panel (Dependencies section).

<a-range-picker
:value="rangeValue"
:mode="['year', 'year']"
:disabled-date="disabledDate"
@change="change" />

{{rangeValue.join(',')}}

<script> import moment from "moment"; import { version } from "ant-design-vue"; export default { name: "App", data() { return { moment, version, rangeValue: [], rangeValueText: [] }; }, methods: { change(data) { this.rangeValueText = data console.log(data) }, disabledDate(curr) { const before = moment(curr.format('YYYY')).isBefore('2009') const after = moment(curr.format('YYYY')).isAfter('2020') return before || after } } }; </script> <style></style>

What is expected?

change 事件有响应
disabledDate 有效果

What is actually happening?

change 事件无响应
disabledDate 无效果

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions