diff --git a/en/application-dev/quick-start/arkts-create-custom-components.md b/en/application-dev/quick-start/arkts-create-custom-components.md index f9219121d87e8281fd9ebcdd244b8c2c66b5b1b9..4e625b11db743797022d30168a16d3d267ce9a62 100644 --- a/en/application-dev/quick-start/arkts-create-custom-components.md +++ b/en/application-dev/quick-start/arkts-create-custom-components.md @@ -117,12 +117,12 @@ To fully understand the preceding example, a knowledge of the following concepts ## Member Functions/Variables -In addition to the mandatory** build()** function, a custom component may implement other member functions with the following restrictions: +In addition to the mandatory **build()** function, a custom component may implement other member functions with the following restrictions: - Static functions are not supported. -- Access to the member functions is always private. Defining **private** access is optional. Defining access other than **private** is a syntax error. +- Access to the member functions is always private. A custom component can also implement member variables with the following restrictions: @@ -130,7 +130,7 @@ A custom component can also implement member variables with the following restri - Static member variables are not supported. -- Access to the member variables is always private.The access rules of member variables are the same as those of member functions. +- Access to the member variables is always private. The access rules of member variables are the same as those of member functions. - Local initialization is optional for some member variables and mandatory for others. For details about whether local initialization or initialization from the parent component is required, see [State Management](arkts-state-management-overview.md). diff --git a/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md b/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md index 2b8f2293918bef081b6f6377a99d6fdb2e35a03e..7d3b591d7d0af07443d62f70015f94af651f5d44 100644 --- a/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md +++ b/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md @@ -129,12 +129,12 @@ struct MyComponent { build() { Column() { - // When this.showChild is true, the Child child component is created, and Child aboutToAppear is invoked. + // When this.showChild is true, the Child component is created, and Child aboutToAppear is invoked. if (this.showChild) { Child() } - // When this.showChild is false, the Child child component is deleted, and Child aboutToDisappear is invoked. - Button('create or delete Child').onClick(() => { + // When this.showChild is false, the Child component is deleted, and Child aboutToDisappear is invoked. + Button('delete Child').onClick(() => { this.showChild = false; }) // Because of the pushing from the current page to Page2, onPageHide is invoked. diff --git a/en/application-dev/quick-start/arkts-prop.md b/en/application-dev/quick-start/arkts-prop.md index 9ec7914c4937a2e2d779a7520fea12c23d859385..4b98d088bc9911c10eaf02a38abb06c544e27dbb 100644 --- a/en/application-dev/quick-start/arkts-prop.md +++ b/en/application-dev/quick-start/arkts-prop.md @@ -275,7 +275,7 @@ struct ReaderComp { build() { Row() { Text(this.title) - Text(`... ${this.readIt ? 'I have read' : 'I have bot read it'}`) + Text(`... ${this.readIt ? 'I have read' : 'I have not read it'}`) .onClick(() => this.readIt = true) } } @@ -350,17 +350,12 @@ struct MainProgram { } Row() { - Column( + Column() // customCounter must be initialized from the parent component due to lack of local initialization. Here, customCounter2 does not need to be initialized. MyComponent({ customCounter: this.mainCounter }) // customCounter2 of the child component can also be initialized from the parent component. The value from the parent component overwrites the locally assigned value of customCounter2 during initialization. MyComponent({ customCounter: this.mainCounter, customCounter2: this.mainCounter }) }.width('40%') - } - - Row() { - Text('').width(480).height(10) - } } } } diff --git a/en/application-dev/quick-start/arkts-state.md b/en/application-dev/quick-start/arkts-state.md index d9cc3c750e3b2d5ad6a1adb539b177f797c62402..f2d9774861a8a4180856f03ba2714df8feef9f53 100644 --- a/en/application-dev/quick-start/arkts-state.md +++ b/en/application-dev/quick-start/arkts-state.md @@ -235,7 +235,7 @@ struct MyComponent { }) Button(`Click to increase count=${this.count}`).onClick(() => { - // The update of the @State decorated variable triggers the update of the component. + // The update of the @State decorated variable triggers the update of the