Commit 356953d9588b0865852569763ab6993d5b8bf8ad
1 parent
d16dce64
fixed #201
fixed #201
Showing
2 changed files
with
9 additions
and
15 deletions
Show diff stats
src/components/date-picker/panel/date.vue
@@ -181,6 +181,7 @@ | @@ -181,6 +181,7 @@ | ||
181 | 181 | ||
182 | this.year = this.date.getFullYear(); | 182 | this.year = this.date.getFullYear(); |
183 | this.month = this.date.getMonth(); | 183 | this.month = this.date.getMonth(); |
184 | + if (reset) this.isTime = false; | ||
184 | }, | 185 | }, |
185 | prevYear () { | 186 | prevYear () { |
186 | if (this.currentView === 'year') { | 187 | if (this.currentView === 'year') { |
test/routers/date.vue
1 | <template> | 1 | <template> |
2 | - {{value1}} -- {{ value2 }} | ||
3 | - <row> | ||
4 | - <i-col span="12"> | ||
5 | - <Date-picker :value.sync="value1" format="yyyy年MM月dd日" type="date" placeholder="选择日期" style="width: 200px"></Date-picker> | ||
6 | - </i-col> | ||
7 | - <i-col span="12"> | ||
8 | - <Date-picker :value.sync="value2" format="yyyy/MM/dd" type="daterange" placement="bottom-end" placeholder="选择日期" style="width: 200px"></Date-picker> | ||
9 | - </i-col> | ||
10 | - </row> | 2 | + <Date-picker type="datetime" placeholder="选择日期和时间" style="width: 200px"></Date-picker> |
3 | + <br> | ||
4 | + <Date-picker type="datetime" format="yyyy-MM-dd HH:mm" placeholder="选择日期和时间(不含秒)" style="width: 200px"></Date-picker> | ||
5 | + <br> | ||
6 | + <Date-picker type="datetimerange" placeholder="选择日期和时间" style="width: 300px"></Date-picker> | ||
7 | + <br> | ||
8 | + <Date-picker type="datetimerange" format="yyyy-MM-dd HH:mm" placeholder="选择日期和时间(不含秒)" style="width: 300px"></Date-picker> | ||
11 | </template> | 9 | </template> |
12 | <script> | 10 | <script> |
13 | export default { | 11 | export default { |
14 | - data () { | ||
15 | - return { | ||
16 | - value1: '2016-01-01', | ||
17 | - value2: ['2016-01-01', '2016-02-15'] | ||
18 | - } | ||
19 | - } | 12 | + |
20 | } | 13 | } |
21 | </script> | 14 | </script> |