Skip to content

Commit

Permalink
docs: 修正 onChange 的 bind (#1382)
Browse files Browse the repository at this point in the history
修正 onChange 的 bind 语句,以免误导菜鸟新用户(比如我)。

## 背景:

我直接复制了示例代码,发现不能编辑文本框中的值(固定为 value),看了好久才发现是实力代码有坑……
  • Loading branch information
Jeff-Tian authored Sep 30, 2022
1 parent 829595e commit 9866976
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-ui-docs/markdown/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class Index extends Taro.Component {
type='text'
placeholder='单行文本'
value={this.state.value}
onChange={this.handleChange.bind(this, 'value')}
onChange={this.handleChange.bind(this)}
/>
<AtButton formType='submit'>提交</AtButton>
<AtButton formType='reset'>重置</AtButton>
Expand Down

0 comments on commit 9866976

Please sign in to comment.