From a87138e24e23d3bad60118b4d8907ccc5c2c7e7d Mon Sep 17 00:00:00 2001 From: zhangjunjie Date: Thu, 6 Jun 2019 11:04:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20Input=20=E5=85=B3=E4=BA=8E?= =?UTF-8?q?=20Prefix/suffix=20=E7=9A=84=E8=BF=94=E5=9B=9E=E5=80=BC?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/input.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/zh-CN/components/input.md b/docs/zh-CN/components/input.md index 16920f375..687016905 100644 --- a/docs/zh-CN/components/input.md +++ b/docs/zh-CN/components/input.md @@ -169,6 +169,9 @@ constructor () { }] } } +changeEvent (e, val) { + console.log(e.target.value, val) +} render() { const Row = Grid.Row const Col = Grid.Col @@ -200,6 +203,7 @@ render() { style={{width: '250px'}} suffix={suffix} prefix={prefix} + onChange={this.changeEvent.bind(this)} /> @@ -346,6 +350,6 @@ render() { | onKeyDown | 触发 keydown 事件 | (event: Event, value: 原始值) | | onKeyPress | 触发 keypress 事件 | (event: Event, value: 原始值) | | onInput | 触发 input 事件 | (event: Event, value: 原始值) | -| onChange | 值改变时触发 | (event: Event, value: 原始值) | +| onChange | 值改变时触发 | (event: Event, value: 原始值)
当 Input 包含 prefix 或 suffix 属性时,value 会得到拼接后的值,如果需要得到原始的值,可以使用 event.target.value 获取 | | onKeyUp | 触发 keyup 事件 | (event: Event, value: 原始值) |