Commit 2a21b455a362facbc13606eca9c6856d6f416a78
Committed by
GitHub
Merge pull request #32 from iview/2.0
update
Showing
5 changed files
with
22 additions
and
6 deletions
Show diff stats
src/components/input/input.vue
src/components/modal/modal.vue
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | </transition> |
6 | 6 | <div :class="wrapClasses" :style="wrapStyles" @click="handleWrapClick"> |
7 | 7 | <transition :name="transitionNames[0]" @after-leave="animationFinish"> |
8 | - <div :class="classes" :style="mainStyles" v-show="visible"> | |
8 | + <div :class="classes" :style="mainStyles" v-show="visible" @mousedown="handleMousedown"> | |
9 | 9 | <div :class="contentClasses" ref="content" :style="contentStyles" @click="handleClickModal"> |
10 | 10 | <a :class="[prefixCls + '-close']" v-if="closable" @click="close"> |
11 | 11 | <slot name="close"> |
... | ... | @@ -140,6 +140,7 @@ |
140 | 140 | dragging: false |
141 | 141 | }, |
142 | 142 | modalIndex: this.handleGetModalIndex(), // for Esc close the top modal |
143 | + isMouseTriggerIn: false, // #5800 | |
143 | 144 | }; |
144 | 145 | }, |
145 | 146 | computed: { |
... | ... | @@ -243,10 +244,17 @@ |
243 | 244 | } |
244 | 245 | }, |
245 | 246 | handleWrapClick (event) { |
247 | + if (this.isMouseTriggerIn) { | |
248 | + this.isMouseTriggerIn = false; | |
249 | + return; | |
250 | + } | |
246 | 251 | // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className |
247 | 252 | const className = event.target.getAttribute('class'); |
248 | 253 | if (className && className.indexOf(`${prefixCls}-wrap`) > -1) this.handleMask(); |
249 | 254 | }, |
255 | + handleMousedown () { | |
256 | + this.isMouseTriggerIn = true; | |
257 | + }, | |
250 | 258 | cancel () { |
251 | 259 | this.close(); |
252 | 260 | }, | ... | ... |
src/components/select/select.vue
src/components/table/table-head.vue
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 | <span v-if="!column.renderHeader">{{ column.title || '' }}</span> |
17 | 17 | <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header> |
18 | 18 | </template> |
19 | - <template v-else-if="column.type === 'selection'"><Checkbox :value="isSelectAll" :disabled="!data.length" @on-change="selectAll"></Checkbox></template> | |
19 | + <template v-else-if="column.type === 'selection'"><Checkbox :value="isSelectAll" :disabled="isSelectDisabled" @on-change="selectAll"></Checkbox></template> | |
20 | 20 | <template v-else> |
21 | 21 | <span v-if="!column.renderHeader" :class="{[prefixCls + '-cell-sort']: column.sortable}" @click="handleSortByHead(getColumn(rowIndex, index)._index)">{{ column.title || '#' }}</span> |
22 | 22 | <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header> |
... | ... | @@ -61,7 +61,7 @@ |
61 | 61 | </template> |
62 | 62 | </div> |
63 | 63 | </th> |
64 | - | |
64 | + | |
65 | 65 | <th v-if="$parent.showVerticalScrollBar && rowIndex===0" :class='scrollBarCellClass()' :rowspan="headRows.length"></th> |
66 | 66 | </tr> |
67 | 67 | </thead> |
... | ... | @@ -121,6 +121,12 @@ |
121 | 121 | } else { |
122 | 122 | return [this.columns]; |
123 | 123 | } |
124 | + }, | |
125 | + isSelectDisabled () { | |
126 | + let isSelectDisabled = false; | |
127 | + if (!this.data.length) isSelectDisabled = true; | |
128 | + if (!this.data.find(item => !item._disabled)) isSelectDisabled = true; | |
129 | + return isSelectDisabled; | |
124 | 130 | } |
125 | 131 | }, |
126 | 132 | methods: { | ... | ... |