6 Program to demonstrate Key Modifiers in VueJS

Program:

index.html:

<!DOCTYPE html>
<html>

<body>
    <div id="ad">

        <button v-on:keyup="keypressed"> Press UP Key </button>

    </div>

    <pre>   
    Different  Modifiers:

    .enter
    .tab
    .delete (captures both "Delete" and "Backspace" keys)
    .esc
    .space
    .up
    .down
    .left
    .right
    #System
    .ctrl
    .alt
    .shift
    .meta
    </pre>

    <div style="margin-top:500px;"></div>
    <script src="https://unpkg.com/vue"></script>
    <script type="text/javascript" src="./index.js"> </script>


</body>

</html>


index.js:

var app = new Vue({

    el: '#ad',



    methods: {

        keypressed: function () {

            alert("You are Presses Up Key")

        },

    }

});


Output:

Key Modifiers in VueJS

Previous
Next Post »