zoukankan      html  css  js  c++  java
  • vue27-2.0-自定义键盘事件

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>智能社——http://www.zhinengshe.com</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <style>
    
        </style>
        <script src="vue.js"></script>
        <script>
            /*       
    5. 自定义键盘指令
        之前:Vue.directive('on').keyCodes.f1=17;    
        
        现在:  Vue.config.keyCodes.ctrl=17
        Vue.directive('on').keyCodes.ctrl=17;*/
        
            Vue.config.keyCodes.ctrl=17;
    
            window.onload=function(){
                new Vue({
                    el:'#box',
                    data:{
                    },
                    methods:{
                        change(){
                            alert('改变了');
                        }
                    }
                });
            };
        </script>
    </head>
    <body>
        <div id="box">
            <input type="text" @keyup.ctrl="change">
        </div>
    </body>
    </html>
  • 相关阅读:
    multition pattern
    singleton pattern
    strategy pattern
    设置Activity的属性
    iphone自动旋转与调整大小
    游戏编程从哪里开始呢
    TTF字体文件使用
    TextMate介绍
    ios程序崩溃处理
    ios笔试题
  • 原文地址:https://www.cnblogs.com/yaowen/p/6985734.html
Copyright © 2011-2022 走看看