Skip to content

Commit 9866976

Browse files
authored
docs: 修正 onChange 的 bind (#1382)
修正 onChange 的 bind 语句,以免误导菜鸟新用户(比如我)。 ## 背景: 我直接复制了示例代码,发现不能编辑文本框中的值(固定为 value),看了好久才发现是实力代码有坑……
1 parent 829595e commit 9866976

File tree

1 file changed

+1
-1
lines changed
  • packages/taro-ui-docs/markdown

1 file changed

+1
-1
lines changed

packages/taro-ui-docs/markdown/form.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default class Index extends Taro.Component {
6060
type='text'
6161
placeholder='单行文本'
6262
value={this.state.value}
63-
onChange={this.handleChange.bind(this, 'value')}
63+
onChange={this.handleChange.bind(this)}
6464
/>
6565
<AtButton formType='submit'>提交</AtButton>
6666
<AtButton formType='reset'>重置</AtButton>

0 commit comments

Comments
 (0)