最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Vue中mintui的field实现blur和focus事件的方法
时间:2022-06-25 15:43:11 编辑:袖梨 来源:一聚教程网
首先上代码说总结:
methods: { checkCard() { console.log('1111'); } }
使用@blur.native.capture=""即可实现。
另一种方法:
使用vue-directive指令实现。这种方法有个问题没解决,不推荐使用。
Vue.directive('mintblur', { // 暂不使用directive实现blur事件了,使用@blur.native.capture="cardNoBlur"即可。 inserted: function(el, pra, a) { let oInput = el.querySelector('input'); console.log('oInput', oInput); oInput.onfocus = function() { // 创建focus的事件 }; oInput.onblur = function() { console.log('blu1r'); this.$emit(pra.expression); }; } });
这种方法暂不支持类似于v-mintblur="myfunction"调用自定义函数处理功能:
相关文章
- 胖企鹅NFT地板价24小时涨15.6% 08-02
- 《寻道大千》新版幽冥战场穿搭攻略 08-02
- UU Wallet 推出零门槛 VISA 铂金卡,全球通付即刻开启 08-02
- 哈利波特魔法觉醒密室开启怎么打?密室开启满星卡组攻略 08-02
- 新盗墓笔记投资基金值得买吗?新盗墓笔记投资基金收益情况介绍 08-02
- 2025年数字货币交易平台推荐 十大虚拟币交易app排名 08-02