最新下载
热门教程
- 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"调用自定义函数处理功能:
相关文章
- 异环尖叫电波道具获取攻略-尖叫电波道具怎么获得 05-31
- PHP addcslashes()函数讲解 05-31
- SQL+HTML+PHP 一个简单论坛网站的综合开发案例(注册、登录、注销、修改信息、留言等) 05-31
- 燕云十六声春节版本攻略 霜催落月桃靥剑姬天赋怎么做 05-31
- Transformer在数独求解中线性表示高度结构化世界模型 05-31
- maya软件对电脑配置要求 05-31