Commit 7b7178f1650c3bd54d2a8d411995f4bc10679e9d
1 parent
f7674b5b
fixed #528
Showing
3 changed files
with
7 additions
and
3 deletions
Show diff stats
.gitignore
examples/routers/date.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | {{ val1 }} | 3 | {{ val1 }} |
4 | - <Date-picker v-model="val1" type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker> | 4 | + <Date-picker v-model="val1" type="date" placeholder="选择日期" style="width: 200px"></Date-picker> |
5 | <div @click="val1 = '2017-03-02'">change</div> | 5 | <div @click="val1 = '2017-03-02'">change</div> |
6 | </div> | 6 | </div> |
7 | </template> | 7 | </template> |
src/components/date-picker/picker.vue
@@ -359,8 +359,11 @@ | @@ -359,8 +359,11 @@ | ||
359 | this.showClose = false; | 359 | this.showClose = false; |
360 | }, | 360 | }, |
361 | handleIconClick () { | 361 | handleIconClick () { |
362 | - if (!this.showClose) return; | ||
363 | - this.handleClear(); | 362 | + if (this.showClose) { |
363 | + this.handleClear(); | ||
364 | + } else { | ||
365 | + this.handleFocus(); | ||
366 | + } | ||
364 | }, | 367 | }, |
365 | handleClear () { | 368 | handleClear () { |
366 | this.visible = false; | 369 | this.visible = false; |