11import PropTypes from '../_util/vue-types' ;
22import { cloneElement } from '../_util/vnode' ;
3- import { getOptionProps } from '../_util/props-util' ;
3+ import { getOptionProps , getListeners } from '../_util/props-util' ;
44function chaining ( ...fns ) {
55 return function ( ...args ) {
66 // eslint-disable-line
@@ -14,6 +14,7 @@ function chaining(...fns) {
1414}
1515export default {
1616 name : 'InputElement' ,
17+ inheritAttrs : false ,
1718 props : {
1819 value : PropTypes . any ,
1920 disabled : PropTypes . bool ,
@@ -30,16 +31,17 @@ export default {
3031 } ,
3132
3233 render ( ) {
33- const { $slots = { } , $listeners = { } , $attrs = { } } = this ;
34+ const { $slots = { } , $attrs = { } } = this ;
35+ const listeners = getListeners ( this ) ;
3436 const props = getOptionProps ( this ) ;
3537 const value = props . value === undefined ? '' : props . value ;
3638 const children = $slots . default [ 0 ] ;
3739 const { componentOptions = { } } = $slots . default [ 0 ] ;
38- const { listeners = { } } = componentOptions ;
39- const newEvent = { ...listeners } ;
40+ const { listeners : events = { } } = componentOptions ;
41+ const newEvent = { ...events } ;
4042
41- for ( const [ eventName , event ] of Object . entries ( $ listeners) ) {
42- newEvent [ eventName ] = chaining ( event , listeners [ eventName ] ) ;
43+ for ( const [ eventName , event ] of Object . entries ( listeners ) ) {
44+ newEvent [ eventName ] = chaining ( event , events [ eventName ] ) ;
4345 }
4446
4547 return cloneElement ( children , {
0 commit comments