How does keyup.tab block browser default events in vue

binding keyup.tab.prevent in vue cannot prevent tab browser default events

related codes

@keyup.stop.prevent="onKeyup"

methods: {
    onKeyup(e){
        e.preventDefault();
        switch (e.keyCode) {
          // tab
          case 9:
             ......
        }
        return false 
    }
}

as in the code above, keyup is bound in template and also specifies that e.preventDefault () and return false, are also used in the modifier prevent,onKeyup method, but neither prevents the default event of the tab key.

is there any other solution?


//        
    $(document).ready(function () {
        $(document).bind('keydown', function (event) {
            if (event.keyCode == 9) {
               return false;
            }
        });
    });

ask the same question: want to write the ES6+AMD specification


advance the timing of preventDefault to keydown


actually, the default tab of the browser is the keydown event, and your prevent on keyup is invalid, as are some other events such as ctrl+s.

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