Merge pull request #123 from Leopoldthecoder/next

fix pagination icon/dialog slot/fixed-column table
pull/2/head
cinwell.li 2016-08-31 11:21:21 +08:00 committed by GitHub
commit 69655b734e
3 changed files with 23 additions and 8 deletions

View File

@ -8,7 +8,7 @@
<i class="el-dialog__close el-icon el-icon-close" @click='close()'></i>
</div>
</div>
<div class="el-dialog__body"><slot></slot></div>
<div class="el-dialog__body" v-if="rendered"><slot></slot></div>
<div class="el-dialog__footer" v-if="$slots.footer">
<slot name="footer"></slot>
</div>

View File

@ -5,11 +5,11 @@
v-if="pageCount > 0"
class="number">1</li>
<li
class="el-icon ellipsis btn-quickprev"
class="el-icon more btn-quickprev"
:class="[quickprevIconClass]"
v-if="showPrevMore"
@mouseenter="quickprevIconClass = 'el-icon-d-arrow-left'"
@mouseleave="quickprevIconClass = 'el-icon-ellipsis'"
@mouseleave="quickprevIconClass = 'el-icon-more'"
>
</li>
<li
@ -17,11 +17,11 @@
:class="{ active: currentPage === pager }"
class="number">{{ pager }}</li>
<li
class="el-icon ellipsis btn-quicknext"
class="el-icon more btn-quicknext"
:class="[quicknextIconClass]"
v-if="showNextMore"
@mouseenter="quicknextIconClass = 'el-icon-d-arrow-right'"
@mouseleave="quicknextIconClass = 'el-icon-ellipsis'"
@mouseleave="quicknextIconClass = 'el-icon-more'"
>
</li>
<li
@ -52,7 +52,7 @@
const pageCount = this.pageCount;
const currentPage = this.currentPage;
if (target.className.indexOf('ellipsis') !== -1) {
if (target.className.indexOf('more') !== -1) {
if (target.className.indexOf('quickprev') !== -1) {
newPage = currentPage - 5;
} else if (target.className.indexOf('quicknext') !== -1) {
@ -130,8 +130,8 @@
current: null,
showPrevMore: false,
showNextMore: false,
quicknextIconClass: 'el-icon-ellipsis',
quickprevIconClass: 'el-icon-ellipsis'
quicknextIconClass: 'el-icon-more',
quickprevIconClass: 'el-icon-more'
};
}
};

View File

@ -421,6 +421,21 @@
const style = this.$refs.fixed.style;
if (!style) return;
style.height = this.$el.clientHeight + 'px';
// ,
let bodyHeight = this.$el.querySelector('.el-table__body-wrapper').offsetHeight;
let fixedBodyHeight = this.$el.querySelector('.el-table__fixed-body-wrapper').offsetHeight;
if (bodyHeight !== fixedBodyHeight) {
let bodyTrs = this.$el.querySelector('.el-table__body-wrapper').querySelectorAll('tr');
let fixedBodyTrs = this.$el.querySelector('.el-table__fixed-body-wrapper').querySelectorAll('tr');
bodyTrs.forEach((tr, index) => {
let trHeight = tr.offsetHeight;
let fixedTrHeight = fixedBodyTrs[index].offsetHeight;
if (trHeight !== fixedTrHeight) {
fixedBodyTrs[index].style.height = trHeight + 'px';
}
});
}
});
}
},