未验证 提交 58394532 编写于 作者: 葛亚芳 提交者: Gitee

update en/application-dev/quick-start/start-with-ets.md.

Signed-off-by: N@ge-yafang <geyafang@huawei.com>
上级 351a955a
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
After the project synchronization is complete, choose **entry** &gt; **src** &gt; **main** &gt; **ets** &gt; **MainAbility** &gt; **pages** in the **Project** window and open the **index.ets** file. You can see that the file contains a **&lt;Text&gt;** component. The sample code in the **index.ets** file is shown below: After the project synchronization is complete, choose **entry** &gt; **src** &gt; **main** &gt; **ets** &gt; **MainAbility** &gt; **pages** in the **Project** window and open the **index.ets** file. You can see that the file contains a **&lt;Text&gt;** component. The sample code in the **index.ets** file is shown below:
``` ```ts
// index.ets
@Entry @Entry
@Component @Component
struct Index { struct Index {
...@@ -66,7 +67,8 @@ ...@@ -66,7 +67,8 @@
On the default page, add a **&lt;Button&gt;** component to respond to user clicks and implement redirection to another page. The sample code in the **index.ets** file is shown below: On the default page, add a **&lt;Button&gt;** component to respond to user clicks and implement redirection to another page. The sample code in the **index.ets** file is shown below:
``` ```ts
// index.ets
@Entry @Entry
@Component @Component
struct Index { struct Index {
...@@ -119,7 +121,8 @@ ...@@ -119,7 +121,8 @@
Add **&lt;Text&gt;** and **&lt;Button&gt;** components and set their styles, as you do for the first page. The sample code in the **second.ets** file is shown below: Add **&lt;Text&gt;** and **&lt;Button&gt;** components and set their styles, as you do for the first page. The sample code in the **second.ets** file is shown below:
``` ```ts
// second.ets
@Entry @Entry
@Component @Component
struct Second { struct Second {
...@@ -161,7 +164,8 @@ You can implement page redirection through the page router, which finds the targ ...@@ -161,7 +164,8 @@ You can implement page redirection through the page router, which finds the targ
In the **index.ets** file of the first page, bind the **onClick** event to the **Next** button so that clicking the button redirects the user to the second page. The sample code in the **index.ets** file is shown below: In the **index.ets** file of the first page, bind the **onClick** event to the **Next** button so that clicking the button redirects the user to the second page. The sample code in the **index.ets** file is shown below:
``` ```ts
// index.ets
import router from '@ohos.router'; import router from '@ohos.router';
@Entry @Entry
...@@ -205,7 +209,8 @@ You can implement page redirection through the page router, which finds the targ ...@@ -205,7 +209,8 @@ You can implement page redirection through the page router, which finds the targ
In the **second.ets** file of the second page, bind the **onClick** event to the **Back** button so that clicking the button redirects the user back to the first page. The sample code in the **second.ets** file is shown below: In the **second.ets** file of the second page, bind the **onClick** event to the **Back** button so that clicking the button redirects the user back to the first page. The sample code in the **second.ets** file is shown below:
``` ```ts
// second.ets
import router from '@ohos.router'; import router from '@ohos.router';
@Entry @Entry
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册