diff --git a/components/input/Input.vue b/components/input/Input.vue
index f8596244f..b3779cff9 100644
--- a/components/input/Input.vue
+++ b/components/input/Input.vue
@@ -151,35 +151,37 @@ export default {
const otherProps = omit(this.$props, [
'prefixCls',
])
- const { stateValue, getInputClassName, handleKeyDown, handleChange } = this
- const attrs = {
+ const { stateValue, getInputClassName, handleKeyDown, handleChange, $listeners } = this
+ const inputProps = {
+ domProps: {
+ value: stateValue,
+ },
attrs: { ...otherProps, ...this.$attrs },
+ on: {
+ ...$listeners,
+ keydown: handleKeyDown,
+ input: handleChange,
+ },
+ class: getInputClassName(),
+ ref: 'input',
}
return this.renderLabeledIcon(
,
)
},
},
render () {
if (this.$props.type === 'textarea') {
- const self = this
+ const { $listeners } = this
const textareaProps = {
props: this.$props,
attrs: this.$attrs,
on: {
- change (e) {
- self.handleChange(e)
- },
- keydown (e) {
- self.handleKeyDown(e)
- },
+ ...$listeners,
+ change: this.handleChange,
+ keydown: this.handleKeyDown,
},
}
return
diff --git a/components/input/demo/basic.vue b/components/input/demo/basic.vue
index a8ef283bd..4201fb155 100644
--- a/components/input/demo/basic.vue
+++ b/components/input/demo/basic.vue
@@ -1,12 +1,3 @@
-