Commit c6f21c2f4c8ae7eb1b1c3b42034bf4f8789faa57
1 parent
3d9e4f20
fix ie bug
Showing
5 changed files
with
38 additions
and
7 deletions
Show diff stats
package.json
src/components/table/table-body.vue
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <tbody :class="[prefixCls + '-tbody']"> |
| 7 | 7 | <tr |
| 8 | 8 | v-for="(index, row) in data" |
| 9 | - :class="[prefixCls + '-row', rowClsName(index), {[prefixCls + '-row-highlight']: cloneData[index] && cloneData[index]._isHighlight, [prefixCls + '-row-hover']: cloneData[index] && cloneData[index]._isHover}]" | |
| 9 | + :class="rowClasses(row, index)" | |
| 10 | 10 | @mouseenter.stop="handleMouseIn(index)" |
| 11 | 11 | @mouseleave.stop="handleMouseOut(index)" |
| 12 | 12 | @click.stop="highlightCurrentRow(index)"> |
| ... | ... | @@ -39,6 +39,17 @@ |
| 39 | 39 | fixed: Boolean |
| 40 | 40 | }, |
| 41 | 41 | methods: { |
| 42 | + rowClasses (row, index) { | |
| 43 | + return [ | |
| 44 | + `${this.prefixCls}-row`, | |
| 45 | + this.rowClsName(index), | |
| 46 | + { | |
| 47 | + [`${this.prefixCls}-row-highlight`]: this.cloneData[index] && this.cloneData[index]._isHighlight, | |
| 48 | + [`${this.prefixCls}-row-hover`]: this.cloneData[index] && this.cloneData[index]._isHover | |
| 49 | + } | |
| 50 | + | |
| 51 | + ] | |
| 52 | + }, | |
| 42 | 53 | setCellWidth (column, index) { |
| 43 | 54 | return this.$parent.setCellWidth(column, index); |
| 44 | 55 | }, |
| ... | ... | @@ -56,4 +67,4 @@ |
| 56 | 67 | } |
| 57 | 68 | } |
| 58 | 69 | } |
| 59 | -</script> | |
| 60 | 70 | \ No newline at end of file |
| 71 | +</script> | ... | ... |
src/components/table/table-head.vue
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <thead> |
| 7 | 7 | <tr> |
| 8 | 8 | <th v-for="column in columns" :class="alignCls(column)"> |
| 9 | - <div :class="[prefixCls + '-cell', {[prefixCls + '-hidden']: !fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')}]"> | |
| 9 | + <div :class="cellClasses(column)"> | |
| 10 | 10 | <template v-if="column.type === 'selection'"><Checkbox :checked="isSelectAll" @on-change="selectAll"></Checkbox></template> |
| 11 | 11 | <template v-else>{{{ renderHeader(column, $index) }}}</template> |
| 12 | 12 | </div> |
| ... | ... | @@ -36,6 +36,14 @@ |
| 36 | 36 | } |
| 37 | 37 | }, |
| 38 | 38 | methods: { |
| 39 | + cellClasses (column) { | |
| 40 | + return [ | |
| 41 | + `${this.prefixCls}-cell`, | |
| 42 | + { | |
| 43 | + [`${this.prefixCls}-hidden`]: !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right') | |
| 44 | + } | |
| 45 | + ] | |
| 46 | + }, | |
| 39 | 47 | setCellWidth (column, index) { |
| 40 | 48 | return this.$parent.setCellWidth(column, index); |
| 41 | 49 | }, |
| ... | ... | @@ -62,4 +70,4 @@ |
| 62 | 70 | } |
| 63 | 71 | } |
| 64 | 72 | } |
| 65 | -</script> | |
| 66 | 73 | \ No newline at end of file |
| 74 | +</script> | ... | ... |
src/components/transfer/list.vue
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | <ul :class="prefixCls + '-content'"> |
| 16 | 16 | <li |
| 17 | 17 | v-for="item in showItems | filterBy filterData" |
| 18 | - :class="[prefixCls + '-content-item', {[prefixCls + '-content-item-disabled']: item.disabled}]" | |
| 18 | + :class="itemClasses(item)" | |
| 19 | 19 | @click.prevent="select(item)"> |
| 20 | 20 | <Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox> |
| 21 | 21 | <span>{{ showLabel(item) }}</span> |
| ... | ... | @@ -72,7 +72,7 @@ |
| 72 | 72 | }, |
| 73 | 73 | count () { |
| 74 | 74 | const validKeysCount = this.validKeysCount; |
| 75 | - return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}条`; | |
| 75 | + return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`; | |
| 76 | 76 | }, |
| 77 | 77 | checkedAll () { |
| 78 | 78 | return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0; |
| ... | ... | @@ -82,6 +82,14 @@ |
| 82 | 82 | } |
| 83 | 83 | }, |
| 84 | 84 | methods: { |
| 85 | + itemClasses (item) { | |
| 86 | + return [ | |
| 87 | + `${this.prefixCls}-content-item`, | |
| 88 | + { | |
| 89 | + [`${this.prefixCls}-content-item-disabled`]: item.disabled | |
| 90 | + } | |
| 91 | + ] | |
| 92 | + }, | |
| 85 | 93 | showLabel (item) { |
| 86 | 94 | return this.renderFormat(item); |
| 87 | 95 | }, |
| ... | ... | @@ -118,4 +126,4 @@ |
| 118 | 126 | } |
| 119 | 127 | } |
| 120 | 128 | } |
| 121 | -</script> | |
| 122 | 129 | \ No newline at end of file |
| 130 | +</script> | ... | ... |