Commit 7b7178f1650c3bd54d2a8d411995f4bc10679e9d

Authored by 梁灏
1 parent f7674b5b

fixed #528

@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 *.bak 7 *.bak
8 .DS_Store 8 .DS_Store
9 node_modules/ 9 node_modules/
  10 +node_modules2/
10 .project 11 .project
11 .settings 12 .settings
12 npm-debug.log 13 npm-debug.log
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;