🐛 fix ie bug

This commit is contained in:
jingsam 2016-11-27 01:42:39 +08:00
parent 3d9e4f2065
commit c6f21c2f4c
5 changed files with 38 additions and 7 deletions

View file

@ -36,6 +36,7 @@
"url": "https://github.com/iview/iview/issues"
},
"dependencies": {
"core-js": "^2.4.1",
"popper.js": "^0.6.4"
},
"peerDependencies": {

View file

@ -6,7 +6,7 @@
<tbody :class="[prefixCls + '-tbody']">
<tr
v-for="(index, row) in data"
:class="[prefixCls + '-row', rowClsName(index), {[prefixCls + '-row-highlight']: cloneData[index] && cloneData[index]._isHighlight, [prefixCls + '-row-hover']: cloneData[index] && cloneData[index]._isHover}]"
:class="rowClasses(row, index)"
@mouseenter.stop="handleMouseIn(index)"
@mouseleave.stop="handleMouseOut(index)"
@click.stop="highlightCurrentRow(index)">
@ -39,6 +39,17 @@
fixed: Boolean
},
methods: {
rowClasses (row, index) {
return [
`${this.prefixCls}-row`,
this.rowClsName(index),
{
[`${this.prefixCls}-row-highlight`]: this.cloneData[index] && this.cloneData[index]._isHighlight,
[`${this.prefixCls}-row-hover`]: this.cloneData[index] && this.cloneData[index]._isHover
}
]
},
setCellWidth (column, index) {
return this.$parent.setCellWidth(column, index);
},
@ -56,4 +67,4 @@
}
}
}
</script>
</script>

View file

@ -6,7 +6,7 @@
<thead>
<tr>
<th v-for="column in columns" :class="alignCls(column)">
<div :class="[prefixCls + '-cell', {[prefixCls + '-hidden']: !fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')}]">
<div :class="cellClasses(column)">
<template v-if="column.type === 'selection'"><Checkbox :checked="isSelectAll" @on-change="selectAll"></Checkbox></template>
<template v-else>{{{ renderHeader(column, $index) }}}</template>
</div>
@ -36,6 +36,14 @@
}
},
methods: {
cellClasses (column) {
return [
`${this.prefixCls}-cell`,
{
[`${this.prefixCls}-hidden`]: !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')
}
]
},
setCellWidth (column, index) {
return this.$parent.setCellWidth(column, index);
},
@ -62,4 +70,4 @@
}
}
}
</script>
</script>

View file

@ -15,7 +15,7 @@
<ul :class="prefixCls + '-content'">
<li
v-for="item in showItems | filterBy filterData"
:class="[prefixCls + '-content-item', {[prefixCls + '-content-item-disabled']: item.disabled}]"
:class="itemClasses(item)"
@click.prevent="select(item)">
<Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox>
<span>{{ showLabel(item) }}</span>
@ -72,7 +72,7 @@
},
count () {
const validKeysCount = this.validKeysCount;
return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`;
return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`;
},
checkedAll () {
return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
@ -82,6 +82,14 @@
}
},
methods: {
itemClasses (item) {
return [
`${this.prefixCls}-content-item`,
{
[`${this.prefixCls}-content-item-disabled`]: item.disabled
}
]
},
showLabel (item) {
return this.renderFormat(item);
},
@ -118,4 +126,4 @@
}
}
}
</script>
</script>

View file

@ -1,3 +1,6 @@
// es6 polyfill
import 'core-js/fn/array/find-index'
import Affix from './components/affix';
import Alert from './components/alert';
import BackTop from './components/back-top';