From 6a549ad2b9cec31f95a3c1ece661bfb6c3d9ed5a Mon Sep 17 00:00:00 2001 From: Xiangdong Zhang Date: Mon, 11 Feb 2019 20:59:27 -0600 Subject: [PATCH 01/10] init cn translation --- content/docs/forms.md | 78 +++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/content/docs/forms.md b/content/docs/forms.md index 1a8b599d55..70a56c814a 100644 --- a/content/docs/forms.md +++ b/content/docs/forms.md @@ -8,8 +8,7 @@ redirect_from: - "tips/controlled-input-null-value.html" - "docs/forms-zh-CN.html" --- - -HTML form elements work a little bit differently from other DOM elements in React, because form elements naturally keep some internal state. For example, this form in plain HTML accepts a single name: +在React里,HTML表格元素的工作方式和其他的DOM元素有些不同,这是因为表格元素通常会保持一些内部的状态。例如这个纯HTML表格只接受一个名称: ```html
@@ -21,15 +20,15 @@ HTML form elements work a little bit differently from other DOM elements in Reac
``` -This form has the default HTML form behavior of browsing to a new page when the user submits the form. If you want this behavior in React, it just works. But in most cases, it's convenient to have a JavaScript function that handles the submission of the form and has access to the data that the user entered into the form. The standard way to achieve this is with a technique called "controlled components". +此表格具有默认的HTML表格行为,即用户提交表格后浏览到新页面。在React中,如果你只需要这种行为,你不用任何修改。但是,在大多数情况下,拥有一个处理表单提交的javascript函数和对用户输入的数据的访问是很方便的。实现这一点的标准方法是使用一种称为“受控组件”的技术。 -## Controlled Components {#controlled-components} +## 受控组件 {#controlled-components} -In HTML, form elements such as ``, ` ``` - -In React, a ` ``` -在React中,` ``` -在React中,` ``` -在 React 中,`