Vue keyup prevent

keyup.delete.prevent=""
Why can"t the browser"s backspace be prevented from returning the previous page event by default?

Jun.30,2022

document.onkeypress = forbidBackSpace
document.onkeydown = forbidBackSpace
function forbidBackSpace(e) {
    const keyCode = e.keyCode
    const source = e.target || e.srcElement;
    const nodeName = source.nodeName.toLowerCase()
    if(keyCode === 8 ) {
      if(nodeName != 'input' && nodeName != 'textarea') {
        return false
      }
    }
}

the way I deal with it


you want the keyup/keypress event on prevent window

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-1bedaae-31bac.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-1bedaae-31bac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?