This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div | |
| ref="viewport" | |
| :style="{ height: `${viewportHeight}px` }" | |
| @scroll.passive="onScroll" | |
| > | |
| <div | |
| :style="{ height: `${totalHeight}px` }" | |
| > | |
| <section |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| offsetBody () { | |
| const scrollTop = (this.$refs.viewport as Element).scrollTop | |
| const remainTopNumber = Math.floor(this.remainLineNumber / 2) | |
| const remainTopHeight = remainTopNumber * this.renderLineHeight | |
| const remainBottomHeight = (this.remainLineNumber - remainTopNumber) * this.renderLineHeight | |
| const thresholdHeight = this.thresholdNumber * this.renderLineHeight | |
| const gap = scrollTop - this.bodyTranslateY | |
| const overThreshold = gap < remainTopHeight - thresholdHeight || gap > remainTopHeight + thresholdHeight | |
| const isReachBottom = this.totalHeight - (scrollTop + this.viewportHeight) < remainBottomHeight | |
| const isReachTop = scrollTop < remainTopHeight |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div | |
| ref="viewport" | |
| :style="{ height: `${containerHeight}px` }" | |
| @scroll.passive="onScroll" | |
| > | |
| <table | |
| :class="$style.header" | |
| > | |
| <thead> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <table | |
| :style="{ maxWidth: `${bodyWidthString}` }" | |
| > | |
| <thead ref="head"> | |
| <tr> | |
| <th | |
| v-for="(header,index) in headers" | |
| :key="index" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mouse = "鼠" | |
| cow = "牛" | |
| tiger = "虎" | |
| rabbit = "兔" | |
| dragon = "龍" | |
| snake = "蛇" | |
| horse = "馬" | |
| sheep = "羊" | |
| monkey = "猴" | |
| chicken = "雞" |
OlderNewer