How does the checkbox in element-ui table achieve multiple selection of keyboard events shift?

how to implement shift multiple selection checkbox in el-table

Apr.27,2021

you can listen to shift

then make a loop check when select


my idea is to listen to the keyboard onkeypress event to determine whether it is a shift keystroke. If so, addEventListener, the row serial number of the checkbox in the first and second selected el-table, then call the toggleRowSelection event of the table, pass the line number in, and trigger the selected


thank you for the answer. Now the solution is to addEventListener, keydown and keyup in mounted if keycode is 16. Then change the true and false to the isShift variable, then watch listens for the isShift variable, after the keyup event is triggered, ask for min,max, and then loop through the table's toggleRowSelection event in the [min,max] interval. There are some more detailed situations to be taken into account, so we will not expand here.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c20823-32a40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c20823-32a40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?