fix: 修复最近、收藏、音乐等界面有时候白屏的问题

This commit is contained in:
jmal 2023-08-05 21:05:52 +08:00
parent cc4571f98c
commit a1ce2c5b95

View File

@ -800,7 +800,8 @@ export default {
showUpdateDateItem: true,// 列表模式下是否显示修改时间 showUpdateDateItem: true,// 列表模式下是否显示修改时间
showSizeItem: true,// 列表模式下是否显示文件大小 showSizeItem: true,// 列表模式下是否显示文件大小
stopSortChange: false, stopSortChange: false,
draging: 0,// 是否正在拖拽中,0:没有拖拽,1:拖拽中 draging: 0,// 是否正在拖拽中,0:没有拖拽,1:拖拽中,
getFileListed: false,
} }
}, },
computed: { computed: {
@ -938,6 +939,12 @@ export default {
Bus.$on('msg/file/change', (msg) => this.onmessage(msg)) Bus.$on('msg/file/change', (msg) => this.onmessage(msg))
Bus.$on('msg/file/operation/fault', (msg) => this.onmessageFault(msg)) Bus.$on('msg/file/operation/fault', (msg) => this.onmessageFault(msg))
setTimeout(() => {
if (!this.getFileListed) {
this.getFileList()
}
}, 50)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('keydown', this.keydown, false) window.removeEventListener('keydown', this.keydown, false)
@ -2120,6 +2127,7 @@ export default {
this.path = this.path.replace(/\\/g, '/') this.path = this.path.replace(/\\/g, '/')
}, },
getFileList(onLoad) { getFileList(onLoad) {
this.getFileListed = true
this.beforeLoadData(onLoad) this.beforeLoadData(onLoad)
api.fileList({ api.fileList({
userId: this.$store.state.user.userId, userId: this.$store.state.user.userId,