Element: Setting a defaultvalue on the datepicker is ignored

Created on 29 Nov 2016  ·  5Comments  ·  Source: ElemeFE/element

ElementUI version

1.0.0-rc.2

OS/Browers version

macOS/Chrome 54

Vue version

2.0.0-rc.4

Steps to reproduce

set a defaultvalue "2016" on v-model and pass it to the datepicker with the year format

What is Expected?

The picker shows the value 2016

What is actually happening?

The picker is showing the value 1970

question

All 5 comments

using [email protected]
you can setting type="year"

<el-date-picker v-model="d"  type="year"> </el-date-picker>

example: http://codepen.io/cycold/pen/MbOyvB?editors=1011

@kife-design Please upgrade Element

After some more research, i found that it is NOT working when the data is passed from a parent component, so the data is passed through a prop.

It works fine if the default value is formatted as :default-value (not default-value). The prop in the parent (el-form-item) can stay.

image

not working on me, copy your code @p4m

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sudo-suhas picture sudo-suhas  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments

yubo111 picture yubo111  ·  3Comments

akaylh picture akaylh  ·  3Comments

Kingwl picture Kingwl  ·  3Comments