Skip to content

Commit

Permalink
fix: 修复空值判断错误
Browse files Browse the repository at this point in the history
release 1.0.1
  • Loading branch information
Lruihao committed Sep 25, 2023
1 parent 97ab503 commit 950183e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class Scroller {
// create scroller
const scroller = document.createElement('div')
scroller.classList.add('el-table-horizontal-scrollbar')
scroller.style.bottom = value?.bottom ? convertToPx(value.bottom) : this.offsetBottom
scroller.style.bottom = value?.bottom !== void 0 ? convertToPx(value.bottom) : this.offsetBottom
// set scroller content width to .el-table__body width
const scrollContent = document.createElement('div')
scrollContent.style.width = `${tableBodyWrapperEl.querySelector('.el-table__body').offsetWidth}px`
Expand Down
4 changes: 2 additions & 2 deletions src/utils/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default class Sticky {
}

const tableStickyWrapper = el.querySelector(`${selector}-wrapper`)
tableStickyWrapper.style[styleProperty] = value?.[offsetProperty]
tableStickyWrapper.style[styleProperty] = value?.[offsetProperty] !== void 0
? convertToPx(value[offsetProperty])
: this[offsetProperty]

Expand All @@ -112,7 +112,7 @@ export default class Sticky {
*/
async #initScroller(el, binding, vnode) {
const { value } = binding
const scrollerOffsetBottom = value?.offsetBottom ? convertToPx(value.offsetBottom) : this.offsetBottom
const scrollerOffsetBottom = value?.offsetBottom !== void 0 ? convertToPx(value.offsetBottom) : this.offsetBottom
if (this.#target === 'StickyFooter' && el.scroller) {
// wait for el-table render
await vnode.componentInstance.$nextTick()
Expand Down

0 comments on commit 950183e

Please sign in to comment.