fix: add null checks for refs before invoking methods to prevent potential errors
This commit is contained in:
parent
a745ff70be
commit
246b262a76
@ -313,7 +313,9 @@ export default {
|
||||
this.fileList.map((item, index) => {
|
||||
item.index = index
|
||||
})
|
||||
if (this.$refs.fileListTable) {
|
||||
this.$refs.fileListTable.reloadData(this.fileList)
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (this.$refs.fileListTable) {
|
||||
this.$refs.fileListTable.reloadData(this.fileList)
|
||||
|
||||
@ -282,7 +282,7 @@ export default {
|
||||
item.searchOverall = false
|
||||
}
|
||||
this.debounceSearch(this.searchFileName, false)
|
||||
this.$refs.searchOption.setFilterOption(item)
|
||||
this.$refs.searchOption && this.$refs.searchOption.setFilterOption(item)
|
||||
this.$nextTick(() => {
|
||||
this._isSuggestionHandledBySelect = false
|
||||
})
|
||||
|
||||
@ -50,7 +50,7 @@ export default {
|
||||
event.stopPropagation()
|
||||
}
|
||||
// Del
|
||||
if (keyCode === 8 && !this.inputting && this.selectRowData.length > 0 && !checkPreviewVisible) {
|
||||
if (keyCode === 46 && !this.inputting && this.selectRowData.length > 0 && !checkPreviewVisible) {
|
||||
this.removeOperation()
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
@ -91,7 +91,9 @@ export default {
|
||||
}
|
||||
// ctrl + P / cmd + P
|
||||
if (isCmd && keyCode === 80 && !checkPreviewVisible) {
|
||||
if (this.$refs.searchInput) {
|
||||
this.$refs.searchInput.focus()
|
||||
}
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user