Element: [el-autocomplete]加了.native修饰符,事件不触发,v-on:blur.native="handleBlur"

Created on 6 Mar 2017  ·  2Comments  ·  Source: ElemeFE/element

http://jsfiddle.net/fe2y0qL4/

v-on:blur.native="handleBlur"
handleBlur(){
     console.log('handleBlur');
     this.$message('test blur');
}

Most helpful comment

由于 el-autocomplete 的最外层元素是 div ,所以无法响应 blur 事件。暂时可能需要手动添加事件,比如

this.$refs.autocomplete.$el.querySelector('input').addEventListener('blur', handler)

后面有计划让 el-autocompleteel-input 一样将 blur 事件 $emit 出去。

All 2 comments

由于 el-autocomplete 的最外层元素是 div ,所以无法响应 blur 事件。暂时可能需要手动添加事件,比如

this.$refs.autocomplete.$el.querySelector('input').addEventListener('blur', handler)

后面有计划让 el-autocompleteel-input 一样将 blur 事件 $emit 出去。

你好,请问我这么写问什么增加不上去呢
this.$refs.endRegionComplete[0].$el.querySelector('input').addEventListener('blur', this.regionChange(0));

Was this page helpful?
0 / 5 - 0 ratings

Related issues

no5no6 picture no5no6  ·  3Comments

akaylh picture akaylh  ·  3Comments

sudo-suhas picture sudo-suhas  ·  3Comments

yubo111 picture yubo111  ·  3Comments

FranzSkuffka picture FranzSkuffka  ·  3Comments