Commit 39947c1474e99d924a6b93a59c62db4f874193ef
Committed by
GitHub
Merge pull request #100 from jingsam/fix-ie
fix ie bug in Table and Transfer
Showing
5 changed files
with
38 additions
and
7 deletions
Show diff stats
package.json
@@ -36,6 +36,7 @@ | @@ -36,6 +36,7 @@ | ||
36 | "url": "https://github.com/iview/iview/issues" | 36 | "url": "https://github.com/iview/iview/issues" |
37 | }, | 37 | }, |
38 | "dependencies": { | 38 | "dependencies": { |
39 | + "core-js": "^2.4.1", | ||
39 | "popper.js": "^0.6.4" | 40 | "popper.js": "^0.6.4" |
40 | }, | 41 | }, |
41 | "peerDependencies": { | 42 | "peerDependencies": { |
src/components/table/table-body.vue
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <tbody :class="[prefixCls + '-tbody']"> | 6 | <tbody :class="[prefixCls + '-tbody']"> |
7 | <tr | 7 | <tr |
8 | v-for="(index, row) in data" | 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 | @mouseenter.stop="handleMouseIn(index)" | 10 | @mouseenter.stop="handleMouseIn(index)" |
11 | @mouseleave.stop="handleMouseOut(index)" | 11 | @mouseleave.stop="handleMouseOut(index)" |
12 | @click.stop="highlightCurrentRow(index)"> | 12 | @click.stop="highlightCurrentRow(index)"> |
@@ -39,6 +39,17 @@ | @@ -39,6 +39,17 @@ | ||
39 | fixed: Boolean | 39 | fixed: Boolean |
40 | }, | 40 | }, |
41 | methods: { | 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 | setCellWidth (column, index) { | 53 | setCellWidth (column, index) { |
43 | return this.$parent.setCellWidth(column, index); | 54 | return this.$parent.setCellWidth(column, index); |
44 | }, | 55 | }, |
@@ -56,4 +67,4 @@ | @@ -56,4 +67,4 @@ | ||
56 | } | 67 | } |
57 | } | 68 | } |
58 | } | 69 | } |
59 | -</script> | ||
60 | \ No newline at end of file | 70 | \ No newline at end of file |
71 | +</script> |
src/components/table/table-head.vue
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <thead> | 6 | <thead> |
7 | <tr> | 7 | <tr> |
8 | <th v-for="column in columns" :class="alignCls(column)"> | 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 | <template v-if="column.type === 'selection'"><Checkbox :checked="isSelectAll" @on-change="selectAll"></Checkbox></template> | 10 | <template v-if="column.type === 'selection'"><Checkbox :checked="isSelectAll" @on-change="selectAll"></Checkbox></template> |
11 | <template v-else>{{{ renderHeader(column, $index) }}}</template> | 11 | <template v-else>{{{ renderHeader(column, $index) }}}</template> |
12 | </div> | 12 | </div> |
@@ -36,6 +36,14 @@ | @@ -36,6 +36,14 @@ | ||
36 | } | 36 | } |
37 | }, | 37 | }, |
38 | methods: { | 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 | setCellWidth (column, index) { | 47 | setCellWidth (column, index) { |
40 | return this.$parent.setCellWidth(column, index); | 48 | return this.$parent.setCellWidth(column, index); |
41 | }, | 49 | }, |
@@ -62,4 +70,4 @@ | @@ -62,4 +70,4 @@ | ||
62 | } | 70 | } |
63 | } | 71 | } |
64 | } | 72 | } |
65 | -</script> | ||
66 | \ No newline at end of file | 73 | \ No newline at end of file |
74 | +</script> |
src/components/transfer/list.vue
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <ul :class="prefixCls + '-content'"> | 15 | <ul :class="prefixCls + '-content'"> |
16 | <li | 16 | <li |
17 | v-for="item in showItems | filterBy filterData" | 17 | v-for="item in showItems | filterBy filterData" |
18 | - :class="[prefixCls + '-content-item', {[prefixCls + '-content-item-disabled']: item.disabled}]" | 18 | + :class="itemClasses(item)" |
19 | @click.prevent="select(item)"> | 19 | @click.prevent="select(item)"> |
20 | <Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox> | 20 | <Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox> |
21 | <span>{{ showLabel(item) }}</span> | 21 | <span>{{ showLabel(item) }}</span> |
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | }, | 72 | }, |
73 | count () { | 73 | count () { |
74 | const validKeysCount = this.validKeysCount; | 74 | const validKeysCount = this.validKeysCount; |
75 | - return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}条`; | 75 | + return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`; |
76 | }, | 76 | }, |
77 | checkedAll () { | 77 | checkedAll () { |
78 | return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0; | 78 | return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0; |
@@ -82,6 +82,14 @@ | @@ -82,6 +82,14 @@ | ||
82 | } | 82 | } |
83 | }, | 83 | }, |
84 | methods: { | 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 | showLabel (item) { | 93 | showLabel (item) { |
86 | return this.renderFormat(item); | 94 | return this.renderFormat(item); |
87 | }, | 95 | }, |
@@ -118,4 +126,4 @@ | @@ -118,4 +126,4 @@ | ||
118 | } | 126 | } |
119 | } | 127 | } |
120 | } | 128 | } |
121 | -</script> | ||
122 | \ No newline at end of file | 129 | \ No newline at end of file |
130 | +</script> |
src/index.js
1 | +// es6 polyfill | ||
2 | +import 'core-js/fn/array/find-index' | ||
3 | + | ||
1 | import Affix from './components/affix'; | 4 | import Affix from './components/affix'; |
2 | import Alert from './components/alert'; | 5 | import Alert from './components/alert'; |
3 | import BackTop from './components/back-top'; | 6 | import BackTop from './components/back-top'; |