Commit e9dd4dab011911c4200be22f384fd79c8a018119
1 parent
b9041a0d
publish 0.9.11-rc-1
publish 0.9.11-rc-1
Showing
3 changed files
with
36 additions
and
23 deletions
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "iview", | 2 | "name": "iview", |
3 | - "version": "0.9.10", | 3 | + "version": "0.9.11-rc-1", |
4 | "title": "iView", | 4 | "title": "iView", |
5 | "description": "A high quality UI components Library with Vue.js", | 5 | "description": "A high quality UI components Library with Vue.js", |
6 | "homepage": "http://www.iviewui.com", | 6 | "homepage": "http://www.iviewui.com", |
src/components/date-picker/picker.vue
@@ -2,22 +2,24 @@ | @@ -2,22 +2,24 @@ | ||
2 | <div | 2 | <div |
3 | :class="[prefixCls]" | 3 | :class="[prefixCls]" |
4 | v-clickoutside="handleClose"> | 4 | v-clickoutside="handleClose"> |
5 | - <i-input | ||
6 | - v-el:reference | ||
7 | - :class="[prefixCls + '-editor']" | ||
8 | - :readonly="!editable || readonly" | ||
9 | - :disabled="disabled" | ||
10 | - :size="size" | ||
11 | - :placeholder="placeholder" | ||
12 | - :value="visualValue" | ||
13 | - @on-change="handleInputChange" | ||
14 | - @on-focus="handleFocus" | ||
15 | - @on-blur="handleBlur" | ||
16 | - @on-click="handleIconClick" | ||
17 | - @mouseenter="handleInputMouseenter" | ||
18 | - @mouseleave="handleInputMouseleave" | ||
19 | - :icon="iconType"></i-input> | ||
20 | - <Drop v-show="visible" :placement="placement" transition="slide-up" v-ref:drop> | 5 | + <div v-el:reference> |
6 | + <slot> | ||
7 | + <i-input | ||
8 | + :class="[prefixCls + '-editor']" | ||
9 | + :readonly="!editable || readonly" | ||
10 | + :disabled="disabled" | ||
11 | + :size="size" | ||
12 | + :placeholder="placeholder" | ||
13 | + :value="visualValue" | ||
14 | + @on-change="handleInputChange" | ||
15 | + @on-focus="handleFocus" | ||
16 | + @on-click="handleIconClick" | ||
17 | + @mouseenter="handleInputMouseenter" | ||
18 | + @mouseleave="handleInputMouseleave" | ||
19 | + :icon="iconType"></i-input> | ||
20 | + </slot> | ||
21 | + </div> | ||
22 | + <Drop v-show="opened" :placement="placement" transition="slide-up" v-ref:drop> | ||
21 | <div v-el:picker></div> | 23 | <div v-el:picker></div> |
22 | </Drop> | 24 | </Drop> |
23 | </div> | 25 | </div> |
@@ -166,6 +168,10 @@ | @@ -166,6 +168,10 @@ | ||
166 | type: Boolean, | 168 | type: Boolean, |
167 | default: false | 169 | default: false |
168 | }, | 170 | }, |
171 | + open: { | ||
172 | + type: Boolean, | ||
173 | + default: null | ||
174 | + }, | ||
169 | size: { | 175 | size: { |
170 | validator (value) { | 176 | validator (value) { |
171 | return oneOf(value, ['small', 'large']); | 177 | return oneOf(value, ['small', 'large']); |
@@ -195,6 +201,9 @@ | @@ -195,6 +201,9 @@ | ||
195 | } | 201 | } |
196 | }, | 202 | }, |
197 | computed: { | 203 | computed: { |
204 | + opened () { | ||
205 | + return this.open === null ? this.visible : this.open; | ||
206 | + }, | ||
198 | iconType () { | 207 | iconType () { |
199 | return this.showClose ? 'ios-close' : 'ios-calendar-outline'; | 208 | return this.showClose ? 'ios-close' : 'ios-calendar-outline'; |
200 | }, | 209 | }, |
@@ -248,9 +257,6 @@ | @@ -248,9 +257,6 @@ | ||
248 | if (this.readonly) return; | 257 | if (this.readonly) return; |
249 | this.visible = true; | 258 | this.visible = true; |
250 | }, | 259 | }, |
251 | - handleBlur () { | ||
252 | - | ||
253 | - }, | ||
254 | handleInputChange (event) { | 260 | handleInputChange (event) { |
255 | const oldValue = this.visualValue; | 261 | const oldValue = this.visualValue; |
256 | const value = event.target.value; | 262 | const value = event.target.value; |
@@ -325,7 +331,6 @@ | @@ -325,7 +331,6 @@ | ||
325 | this.visible = false; | 331 | this.visible = false; |
326 | this.internalValue = ''; | 332 | this.internalValue = ''; |
327 | this.value = ''; | 333 | this.value = ''; |
328 | - this.emitChange(this.value); | ||
329 | }, | 334 | }, |
330 | showPicker () { | 335 | showPicker () { |
331 | if (!this.picker) { | 336 | if (!this.picker) { |
@@ -353,7 +358,7 @@ | @@ -353,7 +358,7 @@ | ||
353 | this.handleClear(); | 358 | this.handleClear(); |
354 | }); | 359 | }); |
355 | this.picker.$on('on-pick-success', () => { | 360 | this.picker.$on('on-pick-success', () => { |
356 | - this.emitChange(this.value); | 361 | +// this.emitChange(this.value); |
357 | this.visible = false; | 362 | this.visible = false; |
358 | }); | 363 | }); |
359 | 364 | ||
@@ -406,6 +411,11 @@ | @@ -406,6 +411,11 @@ | ||
406 | if (this.picker) { | 411 | if (this.picker) { |
407 | this.picker.$destroy(); | 412 | this.picker.$destroy(); |
408 | } | 413 | } |
414 | + }, | ||
415 | + ready () { | ||
416 | + if (this.open !== null) { | ||
417 | + this.visible = this.open; | ||
418 | + } | ||
409 | } | 419 | } |
410 | } | 420 | } |
411 | </script> | 421 | </script> |
412 | \ No newline at end of file | 422 | \ No newline at end of file |
test/routers/date.vue
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | @on-change="change" | 14 | @on-change="change" |
15 | :confirm="true" | 15 | :confirm="true" |
16 | :options="options" | 16 | :options="options" |
17 | - @on-open-change="change2"></date-picker> | 17 | + open |
18 | + @on-open-change="change2"> | ||
19 | + <p>123</p> | ||
20 | + </date-picker> | ||
18 | </i-col> | 21 | </i-col> |
19 | <i-col span="8"> | 22 | <i-col span="8"> |
20 | <date-picker | 23 | <date-picker |