working on server list
This commit is contained in:
@@ -23,7 +23,7 @@ export default defineComponent({
|
||||
data () {
|
||||
return {
|
||||
toLoad: 10,
|
||||
vlistHeight: 0,
|
||||
vlistHeight: 10,
|
||||
vIndex: 0
|
||||
}
|
||||
},
|
||||
@@ -33,7 +33,14 @@ export default defineComponent({
|
||||
highlighted: String
|
||||
},
|
||||
emits: ['highlightPlayer'],
|
||||
|
||||
mounted () {
|
||||
if (this.$props.list) {
|
||||
this.vlistHeight = (this.$refs.vlist as HTMLElement)?.getBoundingClientRect().height || 0
|
||||
if (this.$props.highlighted) {
|
||||
setTimeout(() => (this.$refs.vlist as HTMLElement)?.scrollBy({ top: ((this.list.findIndex(e => e.id === this.$props.highlighted)) * this.rowHeight) - ((this.$refs.vlist as HTMLElement))?.scrollTop - (this.vlistHeight / 2 - this.$props.rowHeight), behavior: 'smooth' }), 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visibleList () {
|
||||
return this.list.slice(Math.max(this.vIndex, 0), Math.min(this.vIndex + this.visibleCount * 3, this.list.length))
|
||||
|
||||
@@ -62,7 +62,7 @@ export default defineComponent({
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
this.refreshColors
|
||||
const colors = {} as { [key: string]: string }
|
||||
if (this.$refs.container) {
|
||||
if (this.$refs?.container) {
|
||||
const style = getComputedStyle(this.$refs.container as Element)
|
||||
colors.fg = style.getPropertyValue('--foreground')
|
||||
colors.bg = style.getPropertyValue('--bg-color')
|
||||
|
||||
@@ -94,7 +94,6 @@ export default defineComponent({
|
||||
return aVal[argument] - bVal[argument]
|
||||
})
|
||||
}
|
||||
console.log('Sorting the player object took + ' + ((new Date()).getTime() - date.getTime()) + 'ms')
|
||||
if (this.sortingData.direction < 0) {
|
||||
players.reverse()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user