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
@@ -141,9 +141,7 @@ | @@ -141,9 +141,7 @@ | ||
141 | default: false | 141 | default: false |
142 | }, | 142 | }, |
143 | autocomplete: { | 143 | autocomplete: { |
144 | - validator (value) { | ||
145 | - return oneOf(value, ['on', 'off']); | ||
146 | - }, | 144 | + type: String, |
147 | default: 'off' | 145 | default: 'off' |
148 | }, | 146 | }, |
149 | clearable: { | 147 | clearable: { |
src/components/modal/modal.vue
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | </transition> | 5 | </transition> |
6 | <div :class="wrapClasses" :style="wrapStyles" @click="handleWrapClick"> | 6 | <div :class="wrapClasses" :style="wrapStyles" @click="handleWrapClick"> |
7 | <transition :name="transitionNames[0]" @after-leave="animationFinish"> | 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 | <div :class="contentClasses" ref="content" :style="contentStyles" @click="handleClickModal"> | 9 | <div :class="contentClasses" ref="content" :style="contentStyles" @click="handleClickModal"> |
10 | <a :class="[prefixCls + '-close']" v-if="closable" @click="close"> | 10 | <a :class="[prefixCls + '-close']" v-if="closable" @click="close"> |
11 | <slot name="close"> | 11 | <slot name="close"> |
@@ -140,6 +140,7 @@ | @@ -140,6 +140,7 @@ | ||
140 | dragging: false | 140 | dragging: false |
141 | }, | 141 | }, |
142 | modalIndex: this.handleGetModalIndex(), // for Esc close the top modal | 142 | modalIndex: this.handleGetModalIndex(), // for Esc close the top modal |
143 | + isMouseTriggerIn: false, // #5800 | ||
143 | }; | 144 | }; |
144 | }, | 145 | }, |
145 | computed: { | 146 | computed: { |
@@ -243,10 +244,17 @@ | @@ -243,10 +244,17 @@ | ||
243 | } | 244 | } |
244 | }, | 245 | }, |
245 | handleWrapClick (event) { | 246 | handleWrapClick (event) { |
247 | + if (this.isMouseTriggerIn) { | ||
248 | + this.isMouseTriggerIn = false; | ||
249 | + return; | ||
250 | + } | ||
246 | // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className | 251 | // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className |
247 | const className = event.target.getAttribute('class'); | 252 | const className = event.target.getAttribute('class'); |
248 | if (className && className.indexOf(`${prefixCls}-wrap`) > -1) this.handleMask(); | 253 | if (className && className.indexOf(`${prefixCls}-wrap`) > -1) this.handleMask(); |
249 | }, | 254 | }, |
255 | + handleMousedown () { | ||
256 | + this.isMouseTriggerIn = true; | ||
257 | + }, | ||
250 | cancel () { | 258 | cancel () { |
251 | this.close(); | 259 | this.close(); |
252 | }, | 260 | }, |
src/components/select/select.vue
@@ -437,6 +437,8 @@ | @@ -437,6 +437,8 @@ | ||
437 | if (query === null) { | 437 | if (query === null) { |
438 | this.onQueryChange(''); | 438 | this.onQueryChange(''); |
439 | this.values = []; | 439 | this.values = []; |
440 | + // #5620,修复清空搜索关键词后,重新搜索相同的关键词没有触发远程搜索 | ||
441 | + this.lastRemoteQuery = ''; | ||
440 | } | 442 | } |
441 | }, | 443 | }, |
442 | clearSingleSelect(){ // PUBLIC API | 444 | clearSingleSelect(){ // PUBLIC API |
src/components/table/table-head.vue
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | <span v-if="!column.renderHeader">{{ column.title || '' }}</span> | 16 | <span v-if="!column.renderHeader">{{ column.title || '' }}</span> |
17 | <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header> | 17 | <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header> |
18 | </template> | 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 | <template v-else> | 20 | <template v-else> |
21 | <span v-if="!column.renderHeader" :class="{[prefixCls + '-cell-sort']: column.sortable}" @click="handleSortByHead(getColumn(rowIndex, index)._index)">{{ column.title || '#' }}</span> | 21 | <span v-if="!column.renderHeader" :class="{[prefixCls + '-cell-sort']: column.sortable}" @click="handleSortByHead(getColumn(rowIndex, index)._index)">{{ column.title || '#' }}</span> |
22 | <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header> | 22 | <render-header v-else :render="column.renderHeader" :column="column" :index="index"></render-header> |
@@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
61 | </template> | 61 | </template> |
62 | </div> | 62 | </div> |
63 | </th> | 63 | </th> |
64 | - | 64 | + |
65 | <th v-if="$parent.showVerticalScrollBar && rowIndex===0" :class='scrollBarCellClass()' :rowspan="headRows.length"></th> | 65 | <th v-if="$parent.showVerticalScrollBar && rowIndex===0" :class='scrollBarCellClass()' :rowspan="headRows.length"></th> |
66 | </tr> | 66 | </tr> |
67 | </thead> | 67 | </thead> |
@@ -121,6 +121,12 @@ | @@ -121,6 +121,12 @@ | ||
121 | } else { | 121 | } else { |
122 | return [this.columns]; | 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 | methods: { | 132 | methods: { |
src/styles/components/table.less