ElemeFE / element-react

Element UI
https://elemefe.github.io/element-react/index
MIT License
2.83k stars 444 forks source link

value-format="yyyy-MM-dd" 和default-value 不能同时存在,否则default-value不生效 #1048

Open luhongmin opened 4 years ago

luhongmin commented 4 years ago

Description

Explain the issue you met, and describe what you expected to be. If you can write in English, we will be very grateful.

Reproduce Steps

  1. [First Step] <el-date-picker v-model="item.dateRange" type="daterange" range-separator="-" format="yyyy-MM-dd" :default-value="year+'-01-01'" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> 默认日期不生效
  2. [Second Step] 去掉value-format="yyyy-MM-dd" 默认日期生效
  3. [and so on...] 如果这个插件是在一个for循环里面的话,如果两者同时存在,第一个生效,其他不生效

    Error Trace (if possible)

It's better to post up the error stack for us to trace this issue.

Solution

What needs to be done to address this issue? Ideally, provide a pull request with a fix.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.