修复列表项高度随窗口的大小适配问题
This commit is contained in:
@@ -14,7 +14,7 @@ div(:class="$style.songList")
|
||||
th.nobreak(:style="{ width: rowWidth.r6 }") {{$t('material.song_list.action')}}
|
||||
div(:class="$style.content")
|
||||
div(v-if="list.length" :class="$style.content" ref="dom_listContent")
|
||||
material-virtualized-list(:list="list" key-name="songmid" ref="list" :item-height="37"
|
||||
material-virtualized-list(:list="list" key-name="songmid" ref="list" :item-height="listItemHeight"
|
||||
containerClass="scroll" contentClass="list" @contextmenu.native.capture="handleContextMenu")
|
||||
template(#default="{ item, index }")
|
||||
div.list-item(@click="handleDoubleClick($event, index)" @contextmenu="handleListItemRigthClick($event, index)"
|
||||
@@ -72,6 +72,7 @@ div(:class="$style.songList")
|
||||
import { mapGetters } from 'vuex'
|
||||
import { scrollTo, clipboardWriteText, assertApiSupport } from '../../utils'
|
||||
import musicSdk from '../../utils/music'
|
||||
import { windowSizeList } from '@common/config'
|
||||
export default {
|
||||
name: 'MaterialSongList',
|
||||
model: {
|
||||
@@ -162,6 +163,9 @@ export default {
|
||||
},
|
||||
]
|
||||
},
|
||||
listItemHeight() {
|
||||
return parseInt(windowSizeList.find(item => item.id == this.setting.windowSizeId).fontSize) / 16 * 37
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// selectdList(n) {
|
||||
|
||||
@@ -178,7 +178,7 @@ export default {
|
||||
// console.log(continuous)
|
||||
// debugger
|
||||
if (continuous) {
|
||||
if (Math.abs(currentScrollTop - this.scrollTop) < this.itemHeight * 5) return
|
||||
if (Math.abs(currentScrollTop - this.scrollTop) < this.itemHeight * this.outsideNum * 0.6) return
|
||||
// console.log('update')
|
||||
if (currentScrollTop > this.scrollTop) { // scroll down
|
||||
// console.log('scroll down')
|
||||
|
||||
Reference in New Issue
Block a user