diff --git a/package.json b/package.json index 2abae614..0403b7c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iview", - "version": "0.9.10", + "version": "0.9.11-rc-1", "title": "iView", "description": "A high quality UI components Library with Vue.js", "homepage": "http://www.iviewui.com", diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue index 19950500..3911f1d5 100644 --- a/src/components/date-picker/picker.vue +++ b/src/components/date-picker/picker.vue @@ -2,22 +2,24 @@
- - +
+ + + +
+
@@ -166,6 +168,10 @@ type: Boolean, default: false }, + open: { + type: Boolean, + default: null + }, size: { validator (value) { return oneOf(value, ['small', 'large']); @@ -195,6 +201,9 @@ } }, computed: { + opened () { + return this.open === null ? this.visible : this.open; + }, iconType () { return this.showClose ? 'ios-close' : 'ios-calendar-outline'; }, @@ -247,9 +256,6 @@ handleFocus () { if (this.readonly) return; this.visible = true; - }, - handleBlur () { - }, handleInputChange (event) { const oldValue = this.visualValue; @@ -325,7 +331,6 @@ this.visible = false; this.internalValue = ''; this.value = ''; - this.emitChange(this.value); }, showPicker () { if (!this.picker) { @@ -353,7 +358,7 @@ this.handleClear(); }); this.picker.$on('on-pick-success', () => { - this.emitChange(this.value); +// this.emitChange(this.value); this.visible = false; }); @@ -406,6 +411,11 @@ if (this.picker) { this.picker.$destroy(); } + }, + ready () { + if (this.open !== null) { + this.visible = this.open; + } } } \ No newline at end of file diff --git a/test/routers/date.vue b/test/routers/date.vue index 26b5134a..e40c26ca 100644 --- a/test/routers/date.vue +++ b/test/routers/date.vue @@ -14,7 +14,10 @@ @on-change="change" :confirm="true" :options="options" - @on-open-change="change2"> + open + @on-open-change="change2"> +

123

+