🐛 fix ie bug
This commit is contained in:
parent
3d9e4f2065
commit
c6f21c2f4c
5 changed files with 38 additions and 7 deletions
|
@ -36,6 +36,7 @@
|
||||||
"url": "https://github.com/iview/iview/issues"
|
"url": "https://github.com/iview/iview/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"core-js": "^2.4.1",
|
||||||
"popper.js": "^0.6.4"
|
"popper.js": "^0.6.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<tbody :class="[prefixCls + '-tbody']">
|
<tbody :class="[prefixCls + '-tbody']">
|
||||||
<tr
|
<tr
|
||||||
v-for="(index, row) in data"
|
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)"
|
@mouseenter.stop="handleMouseIn(index)"
|
||||||
@mouseleave.stop="handleMouseOut(index)"
|
@mouseleave.stop="handleMouseOut(index)"
|
||||||
@click.stop="highlightCurrentRow(index)">
|
@click.stop="highlightCurrentRow(index)">
|
||||||
|
@ -39,6 +39,17 @@
|
||||||
fixed: Boolean
|
fixed: Boolean
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
setCellWidth (column, index) {
|
||||||
return this.$parent.setCellWidth(column, index);
|
return this.$parent.setCellWidth(column, index);
|
||||||
},
|
},
|
||||||
|
@ -56,4 +67,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th v-for="column in columns" :class="alignCls(column)">
|
<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-if="column.type === 'selection'"><Checkbox :checked="isSelectAll" @on-change="selectAll"></Checkbox></template>
|
||||||
<template v-else>{{{ renderHeader(column, $index) }}}</template>
|
<template v-else>{{{ renderHeader(column, $index) }}}</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,6 +36,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
cellClasses (column) {
|
||||||
|
return [
|
||||||
|
`${this.prefixCls}-cell`,
|
||||||
|
{
|
||||||
|
[`${this.prefixCls}-hidden`]: !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
setCellWidth (column, index) {
|
setCellWidth (column, index) {
|
||||||
return this.$parent.setCellWidth(column, index);
|
return this.$parent.setCellWidth(column, index);
|
||||||
},
|
},
|
||||||
|
@ -62,4 +70,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<ul :class="prefixCls + '-content'">
|
<ul :class="prefixCls + '-content'">
|
||||||
<li
|
<li
|
||||||
v-for="item in showItems | filterBy filterData"
|
v-for="item in showItems | filterBy filterData"
|
||||||
:class="[prefixCls + '-content-item', {[prefixCls + '-content-item-disabled']: item.disabled}]"
|
:class="itemClasses(item)"
|
||||||
@click.prevent="select(item)">
|
@click.prevent="select(item)">
|
||||||
<Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox>
|
<Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox>
|
||||||
<span>{{ showLabel(item) }}</span>
|
<span>{{ showLabel(item) }}</span>
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
},
|
},
|
||||||
count () {
|
count () {
|
||||||
const validKeysCount = this.validKeysCount;
|
const validKeysCount = this.validKeysCount;
|
||||||
return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}条`;
|
return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`;
|
||||||
},
|
},
|
||||||
checkedAll () {
|
checkedAll () {
|
||||||
return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
|
return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
|
||||||
|
@ -82,6 +82,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
itemClasses (item) {
|
||||||
|
return [
|
||||||
|
`${this.prefixCls}-content-item`,
|
||||||
|
{
|
||||||
|
[`${this.prefixCls}-content-item-disabled`]: item.disabled
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
showLabel (item) {
|
showLabel (item) {
|
||||||
return this.renderFormat(item);
|
return this.renderFormat(item);
|
||||||
},
|
},
|
||||||
|
@ -118,4 +126,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// es6 polyfill
|
||||||
|
import 'core-js/fn/array/find-index'
|
||||||
|
|
||||||
import Affix from './components/affix';
|
import Affix from './components/affix';
|
||||||
import Alert from './components/alert';
|
import Alert from './components/alert';
|
||||||
import BackTop from './components/back-top';
|
import BackTop from './components/back-top';
|
||||||
|
|
Loading…
Add table
Reference in a new issue