aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-11 13:21:29 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-17 18:56:38 +0200
commit9df5212a40f5a5011755f987eaf9b63652ef6848 (patch)
tree989390d43581b6c93c3b6981c5de089635e35f3d /apps/files
parent0f68d08b140a69c2385b42bf7bc194a1e0129de5 (diff)
downloadnextcloud-server-9df5212a40f5a5011755f987eaf9b63652ef6848.tar.gz
nextcloud-server-9df5212a40f5a5011755f987eaf9b63652ef6848.zip
perf(files): reuse vnode with unique key
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/components/FileEntry.vue5
-rw-r--r--apps/files/src/components/VirtualList.vue19
2 files changed, 9 insertions, 15 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index c271a6965d7..98b4dfca07c 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -21,7 +21,7 @@
-->
<template>
- <Fragment>
+ <tr :class="{'list__row--active': active}" class="list__row">
<span v-if="source.attributes.failed" class="files-list__row--failed" />
<td class="files-list__row-checkbox">
@@ -151,7 +151,7 @@
:render="column.render"
:source="source" />
</td>
- </Fragment>
+ </tr>
</template>
<script lang='ts'>
@@ -496,6 +496,7 @@ export default Vue.extend({
source() {
this.resetState()
this.debounceIfNotCached()
+ logger.debug('FileEntry source changed', { source: this.source })
},
/**
diff --git a/apps/files/src/components/VirtualList.vue b/apps/files/src/components/VirtualList.vue
index 7780665ab6b..252be00413a 100644
--- a/apps/files/src/components/VirtualList.vue
+++ b/apps/files/src/components/VirtualList.vue
@@ -12,17 +12,13 @@
<!-- Body -->
<tbody :style="tbodyStyle" class="files-list__tbody">
- <tr v-for="(item, i) in renderedItems"
+ <component :is="dataComponent"
+ v-for="(item, i) in renderedItems"
:key="i"
- :class="{'list__row--active': (i >= bufferItems || index <= bufferItems) && (i < shownItems - bufferItems)}"
- class="list__row">
- <component :is="dataComponent"
- :active="(i >= bufferItems || index <= bufferItems) && (i < shownItems - bufferItems)"
- :source="item"
- :index="i"
- :item-height="itemHeight"
- v-bind="extraProps" />
- </tr>
+ :active="(i >= bufferItems || index <= bufferItems) && (i < shownItems - bufferItems)"
+ :source="item"
+ :index="i"
+ v-bind="extraProps" />
</tbody>
<!-- Footer -->
@@ -109,9 +105,6 @@ export default Vue.extend({
this.index = this.scrollToIndex
this.$el.scrollTop = this.index * this.itemHeight + this.beforeHeight
},
- index() {
- logger.debug('VirtualList index updated to ' + this.index)
- },
},
mounted() {