mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 18:34:50 +08:00
进一步完善shift多选
This commit is contained in:
@@ -198,7 +198,7 @@ export default {
|
||||
})
|
||||
},
|
||||
selectionCellClick (selection, row) {
|
||||
if (this.shiftDown && this.selectionBegin !== '') {
|
||||
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
|
||||
this.selectionEnd = row.id
|
||||
const start = Math.min(this.selectionBegin, this.selectionEnd) - 1
|
||||
const end = Math.max(this.selectionBegin, this.selectionEnd)
|
||||
@@ -209,7 +209,11 @@ export default {
|
||||
this.selectionBegin = this.selectionEnd = ''
|
||||
return
|
||||
}
|
||||
this.selectionBegin = row.id
|
||||
if (selection.includes(row)) {
|
||||
this.selectionBegin = row.id
|
||||
} else {
|
||||
this.selectionBegin = ''
|
||||
}
|
||||
},
|
||||
handleSelectionChange (rows) {
|
||||
this.multipleSelection = rows
|
||||
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
return a.group.localeCompare(b.group, 'zh')
|
||||
},
|
||||
selectionCellClick (selection, row) {
|
||||
if (this.shiftDown && this.selectionBegin !== '') {
|
||||
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
|
||||
this.selectionEnd = row.id
|
||||
const start = Math.min(this.selectionBegin, this.selectionEnd) - 1
|
||||
const end = Math.max(this.selectionBegin, this.selectionEnd)
|
||||
@@ -202,7 +202,11 @@ export default {
|
||||
this.selectionBegin = this.selectionEnd = ''
|
||||
return
|
||||
}
|
||||
this.selectionBegin = row.id
|
||||
if (selection.includes(row)) {
|
||||
this.selectionBegin = row.id
|
||||
} else {
|
||||
this.selectionBegin = ''
|
||||
}
|
||||
},
|
||||
handleSelectionChange (rows) {
|
||||
this.multipleSelection = rows
|
||||
|
||||
Reference in New Issue
Block a user