diff --git a/en/application-dev/reference/Readme-EN.md b/en/application-dev/reference/Readme-EN.md
index e5e4ee0ea6213711aa17f1458385298f545d454e..85bb902ce576919aadc1422f1b8c35f7afd75718 100644
--- a/en/application-dev/reference/Readme-EN.md
+++ b/en/application-dev/reference/Readme-EN.md
@@ -1,8 +1,11 @@
# Development References
-- [SysCap List](syscap-list.md)
+- [SystemCapability](syscap.md)
+- [SystemCapability List](syscap-list.md)
- [Component Reference (ArkTS-based Declarative Development Paradigm)](arkui-ts/Readme-EN.md)
- [Component Reference (JavaScript-compatible Web-like Development Paradigm)](arkui-js/Readme-EN.md)
-- [API Reference (JS and TS APIs)](apis/Readme-EN.md)
+- [JS Service Widget UI Component Reference](js-service-widget-ui/Readme-EN.md)
+- [API Reference (ArkTS and JS APIs)](apis/Readme-EN.md)
+- [Error Codes](errorcodes/Readme-EN.md)
- API Reference (Native APIs)
- [Standard Libraries Supported by Native APIs](native-lib/Readme-EN.md)
diff --git a/en/application-dev/reference/arkui-js/Readme-EN.md b/en/application-dev/reference/arkui-js/Readme-EN.md
index d14e06d8a3a83329a2a6e2b508508e03c93aea4c..c35e267119e3865138bc26fb0fe6de4d95c7a836 100644
--- a/en/application-dev/reference/arkui-js/Readme-EN.md
+++ b/en/application-dev/reference/arkui-js/Readme-EN.md
@@ -93,13 +93,11 @@
- [animateMotion](js-components-svg-animatemotion.md)
- [animateTransform](js-components-svg-animatetransform.md)
-
- Custom Components
- [Basic Usage](js-components-custom-basic-usage.md)
- - [Style Inheritance](js-components-custom-style.md)
- - [Custom Events](js-components-custom-events.md)
- [props](js-components-custom-props.md)
- - [Event Parameter](js-components-custom-event-parameter.md)
+ - [Style Inheritance](js-components-custom-style.md)
- [slot](js-components-custom-slot.md)
- [Lifecycle Definition](js-components-custom-lifecycle.md)
-- [Data Type Attributes](js-appendix-types.md)
+- [Dynamic Component Creation](js-components-create-elements.md)
+- [Data Type Attributes](js-appendix-types.md)
diff --git a/en/application-dev/reference/arkui-js/figures/en-us-attributes.gif b/en/application-dev/reference/arkui-js/figures/en-us-attributes.gif
new file mode 100644
index 0000000000000000000000000000000000000000..77a11bb928c4b0d6e66073dd844320fc4e10229c
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us-attributes.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image1.png b/en/application-dev/reference/arkui-js/figures/en-us_image1.png
new file mode 100644
index 0000000000000000000000000000000000000000..971b33355ee838054f24e2a7005c3ef3906a24d1
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image1.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127125126.gif b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127125126.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1b0d4fd3ea6759b909f1714cdb9b0f6794153d76
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127125126.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127284938.gif b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127284938.gif
new file mode 100644
index 0000000000000000000000000000000000000000..86f15fb83d5be7e8ed145d69ed8b869be40c4e45
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001127284938.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152588538.gif b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152588538.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e73de415b9c515a8c173793861ce330b8518de2f
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152588538.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152610806.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152610806.png
index b3a47a84d8086ca0806bc958f745f29821c47cc2..30ab31575654579e9a00a64d3d67f7420662f203 100644
Binary files a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152610806.png and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001152610806.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001167662852.gif b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001167662852.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1346a2deeab10fd18c60e7ff184bbff436bc528f
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001167662852.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001173324703.gif b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001173324703.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6c85de05a6145492a24a9ded5d2b399776489ecc
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001173324703.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001176075554.gif b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001176075554.gif
new file mode 100644
index 0000000000000000000000000000000000000000..16e7ff213bd5caf5a9802001d3ced2996c66e0bc
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001176075554.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_000000117726526811.png b/en/application-dev/reference/arkui-js/figures/en-us_image_000000117726526811.png
new file mode 100644
index 0000000000000000000000000000000000000000..d9d9a17fe607c8acc99d3a7e26c6b4316e0b7f5b
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/en-us_image_000000117726526811.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214619417.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214619417.png
index 5da42e3e14d601745274cb62d914c6600620bb25..4f6c19892155444ecf63dab3ca80575a8046cc1b 100644
Binary files a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214619417.png and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214619417.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214704759.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214704759.png
index 6afdd1b39e4bcb3664c7664a55b47b8537f4aeaa..0b4837fc44abc0e1005de3d1259ed924f2969806 100644
Binary files a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214704759.png and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214704759.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214811029.png b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214811029.png
index 1d71cee4618f1f2822cea1031c9b0e5d602e0a9b..447e5b819bdddc57b98ccf7629d612eb499aec8b 100644
Binary files a/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214811029.png and b/en/application-dev/reference/arkui-js/figures/en-us_image_0000001214811029.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/pickerview1.gif b/en/application-dev/reference/arkui-js/figures/pickerview1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e255be05356073aa2cd2a8cf1fe9080da0cce7bf
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/pickerview1.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/pickerview2.gif b/en/application-dev/reference/arkui-js/figures/pickerview2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ab30fdac7ab76ea4759a61c52cb326b53396d1dc
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/pickerview2.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/pickerview5.gif b/en/application-dev/reference/arkui-js/figures/pickerview5.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fd3a65d962df54eca02bd0a30c06bc1254c11df7
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/pickerview5.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/rainbow.gif b/en/application-dev/reference/arkui-js/figures/rainbow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2dd14c106005c014e3daa8b6132f610280d06516
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/rainbow.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/slider.png b/en/application-dev/reference/arkui-js/figures/slider.png
index d0167fe6773371fa70d8bf32c3a3953ed1e1455b..be1ee572a931ec2f06614e5f17c5616eba462e85 100644
Binary files a/en/application-dev/reference/arkui-js/figures/slider.png and b/en/application-dev/reference/arkui-js/figures/slider.png differ
diff --git a/en/application-dev/reference/arkui-js/figures/stepper.gif b/en/application-dev/reference/arkui-js/figures/stepper.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cfaa06512dacaa75acbc26a65f040c1b1caf32ff
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/stepper.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/switch.gif b/en/application-dev/reference/arkui-js/figures/switch.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1ba8e3e6401faf9c70fe97e4a2eac2181eeec974
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/switch.gif differ
diff --git a/en/application-dev/reference/arkui-js/figures/text.png b/en/application-dev/reference/arkui-js/figures/text.png
new file mode 100644
index 0000000000000000000000000000000000000000..65f36bddf4015f870e67edf7a96d1457014d1b3c
Binary files /dev/null and b/en/application-dev/reference/arkui-js/figures/text.png differ
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-button.md b/en/application-dev/reference/arkui-js/js-components-basic-button.md
index 29061668cc3ddd2c59a2b057a97bb09970807693..bec475bb4689aea314bb6e251e3d270da78000f2 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-button.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-button.md
@@ -18,7 +18,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| Name | Type | Default Value | Mandatory | Description |
| ---------------------- | ------- | ----- | ---- | ---------------------------------------- |
-| type | string | - | No | Button type. The value cannot be dynamically updated. If this attribute is not set, a capsule-like button is displayed. Unlike the capsule button, the capsule-like button allows its corners to be configured using **border-radius**. Available button types are as follows: - **capsule**: capsule button with fillets, background color, and text. - **circle**: circle button that can accommodate icons. - **text**: text button, which displays only text. - **arc**: arc button. This value is applicable to wearables only. - **download**: download button, with an extra download progress bar.|
+| type | string | - | No | Button type. The value cannot be dynamically updated. By default, a capsule-like button is displayed. Unlike the capsule button, the capsule-like button allows its corners to be configured using **border-radius**. The options are as follows: - **capsule**: capsule button with fillets, background color, and text. - **circle**: circle button that can accommodate icons. - **text**: text button, which displays only text. - **arc**: arc button. This value is applicable to wearables only. - **download**: download button, with an extra download progress bar.|
| value | string | - | No | Text value of the button. |
| icon | string | - | No | Path of the button icon. The supported icon formats are JPG, PNG, and SVG. |
| placement5+ | string | end | No | Position of the button icon in text. This attribute is valid only when **type** is not set. Available values are as follows: - **start**: The button icon is at the beginning of the text. - **end**: The button icon is at the end of the text. - **top**: The button icon is at the top of the text. - **bottom**: The button icon is at the bottom of the text.|
@@ -39,7 +39,7 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| font-style | string | normal | No | Font style of the button. |
| font-weight | number \| string | normal | No | Font weight of the button. For details, see **font-weight** of the [**\** component](../arkui-js/js-components-basic-text.md#styles).|
-| font-family | <string> | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text. |
+| font-family | <string> | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
| icon-width | <length> | - | No | Width of the internal icon of a circle button. The entire circle button is filled by default. This style must be set when the icon uses the SVG image.|
| icon-height | <length> | - | No | Height of the internal icon of a circle button. The entire circle button is filled by default. This style must be set when the icon uses the SVG image.|
| radius | <length> | - | No | Corner radius of the button. For a circle button, this style takes precedence over **width** and **height** in the universal styles.|
@@ -55,8 +55,8 @@ In addition to the **background-color**, **opacity**, **display**, **visibility*
| font-size | <length> | 37.5px | No | Font size of the arc button. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. |
| font-style | string | normal | No | Font style of the arc button. |
-| font-weight | number \| string | normal | No | Font weight of the arc button. For details, see **font-weight** of the [**\** component](../arkui-js/js-components-basic-text.md#styles).|
-| font-family | <string> | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text. |
+| font-weight | number \| string | normal | No | Font weight of the arc button. For details, see **font-weight** of the [**\**](../arkui-js/js-components-basic-text.md#styles) component. |
+| font-family | <string> | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
## Events
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-chart.md b/en/application-dev/reference/arkui-js/js-components-basic-chart.md
index 26ac1ef03d97536474103465f8f61cc5108ab126..a11c5aaabf8fa65f15399d5e8b13d9e040e77397 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-chart.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-chart.md
@@ -22,7 +22,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| Name | Type | Default Value | Mandatory | Description |
| ------------------------------ | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
-| type | string | line | No | Chart type. Dynamic modification is not supported. Available values include: - **bar**: bar chart. - **line**: line chart. - **gauge**: gauge chart. - **progress**5+: circle chart of progresses. - **loading**5+: circle chart of loading processes. - **rainbow**5+: circle chart of proportions.|
+| type | string | line | No | Chart type. Dynamic modification is not supported. Available values include: - **bar**: bar chart - **line**: line chart - **gauge**: gauge chart - **progress**5+: circle chart of progresses - **loading**5+: circle chart of loading processes - **rainbow**5+: circle chart of proportions|
| options | ChartOptions | - | No | Chart parameters. You must set parameters for bar charts and line charts. Parameter settings for gauge charts do not take effect. You can set the minimum value, maximum value, scale, and line width of the x-axis or y-axis, whether to display the x-axis and y-axis, and whether the line is smooth. Dynamic modification is not supported.|
| datasets | Array<ChartDataset> | - | No | Data sets. You must set data sets for bar charts and line charts. Data sets for a gauge chart do not take effect. You can set multiple datasets and their background colors.|
| segments5+ | DataSegment \| Array<DataSegment> | - | No | Data structures used by **progress**, **loading**, and **rainbow** charts. **DataSegment** is available for **progress** and **loading** charts. **Array<DataSegment>** is available for **rainbow** charts. A maximum of nine **DataSegment**s are supported in the array.|
@@ -99,7 +99,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| description | string | - | No | Description text of the point. |
| textLocation | string | - | No | Position of the description text relative to the point. Available values are as follows: **top**: above the point **bottom**: below the point **none**: not displayed|
| textColor | <color> | \#000000 | No | Color of the description text. |
-| lineDash | string | solid | No | Dashed line pattern. You can set the dash length and space length between the dashes. For example, **"dashed, 5, 5"** indicates a dashed line with each dash in 5 px and a 5 px space between each two dashes. Default value **"solid"** indicates a solid line.|
+| lineDash | string | solid | No | Dashed line pattern. You can set the dash length and space length between the dashes. - **"dashed, 5, 5"**: dashed line with each dash in 5 px and a 5 px space between each two dashes. Default value **"solid"** indicates a solid line.|
| lineColor | <color> | \#000000 | No | Line color. If this attribute is not set, the value of **strokeColor** is used. |
**Table 9** DataSegment5+
@@ -144,7 +144,7 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| center-x | <length> | - | No | Center of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the **position** style in the common styles, and must be used together with **center-y** and **radius**. This style is supported by the gauge chart only.|
| center-y | <length> | - | No | Center of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the **position** style in the common styles, and must be used together with **center-x** and **radius**. This style is supported by the gauge chart only.|
| radius | <length> | - | No | Radius of the scale bar of the gauge component. This style is supported by the gauge chart only. This style takes precedence over the **width** and **height** in the common styles, and must be used together with **center-x** and **center-y**. This style is supported by the gauge chart only.|
-| colors | Array | - | No | Color of each section for the scale bar of the gauge component. For example, **colors: \#ff0000, #00ff00**. This style is supported by the gauge chart only.|
+| colors | Array | - | No | Color of each section for the scale bar of the gauge component. For example, **colors: \#ff0000, \#00ff00**. This style is supported by the gauge chart only.|
| weights | Array | - | No | Weight of each section for the scale bar of the gauge component. For example, **weights: 2, 2**. This style is supported by the gauge chart only.|
| font-family5+ | Array | - | No | Font style of the description text. You can use a [custom font](../arkui-js/js-components-common-customizing-font.md).|
| font-size5+ | <length> | - | No | Font size of the description text. |
@@ -161,7 +161,7 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
| Name | Parameter | Description |
| ------ | ---------------------------------------- | ---------------------------------------- |
-| append | { serial: number, // Set the data subscript of the line chart to be updated. data: Array<number>, // Set the new data. } | Data is dynamically added to an existing data sequence. The target sequence is specified based on **serial**, which is the subscript of the datasets array and starts from 0. **datasets[index].data** is not updated. Only line charts support this attribute. The value is incremented by 1 based on the horizontal coordinate and is related to the **xAxis min/max** setting.|
+| append | { serial: number, data: Array<number>, } | Data is dynamically added to an existing data sequence. The target sequence is specified based on **serial**, which is the subscript of the datasets array and starts from 0. For example, if the value of **serial** is **index**, use **data** to update **datasets[index].data**. Only line charts support this attribute. The value is incremented by 1 based on the horizontal coordinate and is related to the **xAxis min/max** setting.|
## Example
@@ -212,24 +212,24 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
strokeColor: '#0081ff',
fillColor: '#cce5ff',
data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628, 791, 505, 613, 575, 475, 553, 491, 680, 657, 716],
- gradient: true,
+ gradient: true
}
],
lineOps: {
xAxis: {
min: 0,
max: 20,
- display: false,
+ display: false
},
yAxis: {
min: 0,
max: 1000,
- display: false,
+ display: false
},
series: {
lineStyle: {
width: "5px",
- smooth: true,
+ smooth: true
},
headPoint: {
shape: "circle",
@@ -237,14 +237,14 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
strokeWidth: 5,
fillColor: '#ffffff',
strokeColor: '#007aff',
- display: true,
+ display: true
},
loop: {
margin: 2,
- gradient: true,
+ gradient: true
}
}
- },
+ }
},
addData() {
this.$refs.linechart.append({
@@ -295,15 +295,15 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
barData: [
{
fillColor: '#f07826',
- data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628],
+ data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628]
},
{
fillColor: '#cce5ff',
- data: [535, 776, 615, 444, 694, 785, 677, 609, 562, 410],
+ data: [535, 776, 615, 444, 694, 785, 677, 609, 562, 410]
},
{
fillColor: '#ff88bb',
- data: [673, 500, 574, 483, 702, 583, 437, 506, 693, 657],
+ data: [673, 500, 574, 483, 702, 583, 437, 506, 693, 657]
},
],
barOps: {
@@ -311,14 +311,14 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
min: 0,
max: 20,
display: false,
- axisTick: 10,
+ axisTick: 10
},
yAxis: {
min: 0,
max: 1000,
- display: false,
- },
- },
+ display: false
+ }
+ }
}
}
```
@@ -353,3 +353,76 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
```

+
+4. Circle chart of progresses, loading progresses, or proportions
+ ```html
+
+
+ progress Example
+
+
+
+ loading Example
+
+
+
+ rainbow Example
+
+
+
+
+ ```
+ ```css
+ /* xxx.css */
+ .container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ }
+ .chart-region {
+ height: 400px;
+ width: 700px;
+ margin-top: 10px;
+ }
+ .text {
+ margin-top: 30px;
+ }
+ ```
+ ```js
+ // xxx.js
+ export default {
+ data: {
+ progressdata: {
+ value: 50,
+ name: 'progress'
+ },
+ loadingdata: {
+ startColor: "#ffc0cb",
+ endColor: "#00bfff",
+ },
+ rainbowdata: [
+ {
+ value: 50,
+ name: 'item1'
+ },
+ {
+ value: 10,
+ name: 'item2'
+ },
+ {
+ value: 20,
+ name: 'item3'
+ },
+ {
+ value: 10,
+ name: 'item4'
+ },
+ {
+ value: 10,
+ name: 'item5'
+ }
+ ]
+ }
+ }
+ ```
+ 
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-image.md b/en/application-dev/reference/arkui-js/js-components-basic-image.md
index 53b335e34c30317f99f789bd22358bad5d8ad279..89643b3aaa104e4f15b91db6098e74611c1aa42d 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-image.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-image.md
@@ -31,7 +31,7 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| object-fit | string | cover | No | Image scale type. This style is not supported for SVG images. For details about available values, see **object-fit**.|
| match-text-direction | boolean | false | No | Whether image orientation changes with the text direction. This style is not supported for SVG images. |
| fit-original-size | boolean | false | No | Whether the **\** component adapts to the image source size when its width and height are not set. If this style is set to **true**, **object-fit** will not take effect. This style is not supported for SVG images.|
-| object-position7+ | string | 0px 0px | No | Position of an image in the component. The options are as follows: 1. Pixels. For example, **15px 15px** indicates the moving position along the x-axis or y-axis. 2. Characters. Optional values are as follows: - **left**: The image is displayed on the left of the component. - **top** The image is displayed on the top of the component. - **right** The image is displayed on the right of the component. - **bottom** The image is displayed at the bottom of the component.|
+| object-position7+ | string | 0px 0px | No | Position of the image in the component. The options are as follows: 1. Pixels, in px. For example, **15px 15px** indicates the position to move along the x-axis or y-axis. 2. Characters. Optional values are as follows: - **left**: The image is displayed on the left of the component.< - **top**: The image is displayed on the top of the component. - **right**: The image is displayed on the right of the component. - **bottom**: The image is displayed at the bottom of the component.|
**Table 1** object-fit
@@ -56,16 +56,18 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
> 1. If the **\** component is too small to afford the SVG image, the SVG image is cropped and only its upper left part is displayed in the component.
>
> 2. If the **\** component is big enough to afford the SVG image, this SVG image is displayed in the upper left corner of the component.
+>
+> - For SVG images, only the following tags are included in the supported list: **svg**, **rect**, **circle**, **ellipse**, **path**, **line**, **polyline**, **polygon**, **animate**, **animateMotion**, and **animateTransform**.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
-| Name | Parameter | Description |
-| -------------- | ---------------------------------------- | ------------------------- |
-| complete(Rich) | { width: width, height: height } | Triggered when an image is successfully loaded. The loaded image size is returned.|
-| error(Rich) | { width: width, height: height } | Triggered when an exception occurs during image loading. In this case, the width and height are **0**. |
+| Name | Parameter | Description |
+| -------- | ---------------------------------------- | ------------------------- |
+| complete | { width: width, height: height } | Triggered when an image is successfully loaded. The loaded image size is returned.|
+| error | { width: width, height: height } | Triggered when an exception occurs during image loading. In this case, the width and height are **0**. |
## Methods
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-input.md b/en/application-dev/reference/arkui-js/js-components-basic-input.md
index 2ce4c7d3b07a6e8dbdcd47c4d3143ec8e4b285df..13c42c2f80fe31b010cf38829a6d3a388bb19629 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-input.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-input.md
@@ -20,44 +20,44 @@ Not supported
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
-| Name | Type | Default Value | Mandatory | Description |
-| -------------------------------- | ----------------------- | ------------- | --------- | ---------------------------------------- |
-| type | string | text | No | Type of the input component. Available values include **text**, **email**, **date**, **time**, **number**, **password**, **button**, **checkbox**, and **radio**. The **text**, **email**, **date**, **time**, **number**, and **password** types can be dynamically switched and modified. The **button**, **checkbox**, and **radio** types cannot be dynamically modified. - **button**: a button that can be clicked. - **checkbox**: a check box. - **radio**: a radio button that allows users to select one from multiple others with the same name. - **text**: a single-line text field. - **email**: a field used for an email address. - **date**: date component, including the year, month, and day, but excluding time. - **time**: time component, without the time zone. - **number**: field for entering digits. - **password**: password field, in which characters will be shielded. |
-| checked | boolean | false | No | Whether the **\** component is selected. This attribute is valid only when **type** is set to **checkbox** or **radio**. |
-| name | string | - | No | Name of the **\** component. This attribute is mandatory when **type** is set to **radio**. |
-| value | string | - | No | Value of the **\** component. When **type** is **radio**, this attribute is mandatory and the value must be unique for radio buttons with the same name. |
-| placeholder | string | - | No | Content of the hint text. This attribute is available only when the component type is set to **text** \|email\|date\|time\|number\|**password**. |
-| maxlength | number | - | No | Maximum number of characters that can be entered in the input box. The empty value indicates no limit. |
-| enterkeytype | string | default | No | Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated. Available values include: - default - next - go - done - send - search Except for the **next** type, clicking the Enter key hides the soft keyboard. |
-| headericon | string | - | No | Icon resource path before text input. This icon does not support click events and is unavailable for **button**, **checkbox**, and **radio** types. The supported icon image formats are JPG, PNG, and SVG. |
-| showcounter5+ | boolean | false | No | Whether to display the character counter for an input box. This attribute takes effect only when **maxlength** is set. |
-| menuoptions5+ | Array<MenuOption> | - | No | Menu options displayed after users click the **More** button. |
-| autofocus6+ | boolean | false | No | Whether to automatically obtain focus. This attribute setting does not take effect on the application home page. You can enable a text box on the home page to automatically obtain focus, by delaying the **focus** method call (for about 100–500 ms) in **onActive**. |
-| selectedstart6+ | number | -1 | No | Start position for text selection. |
-| selectedend6+ | number | -1 | No | End position for text selection. |
-| softkeyboardenabled6+ | boolean | true | No | Whether to display the soft keyboard during editing. |
-| showpasswordicon6+ | boolean | true | No | Whether to display the icon at the end of the password text box. This attribute is available only when **type** is set to **password**. |
+| Name | Type | Default Value | Mandatory | Description |
+| -------------------------------- | ----------------------- | --------- | ---- | ---------------------------------------- |
+| type | string | text | No | Type of the input component. Available values include **text**, **email**, **date**, **time**, **number**, **password**, **button**, **checkbox**, and **radio**. The **text**, **email**, **date**, **time**, **number**, and **password** types can be dynamically switched and modified. The **button**, **checkbox**, and **radio** types cannot be dynamically modified. - **button**: a button that can be clicked. - **checkbox**: a check box. - **radio**: a radio button that allows users to select one from multiple others with the same name. - **text**: a single-line text field. - **email**: a field used for an email address. - **date**: date component, including the year, month, and day, but excluding time. - **time**: time component, without the time zone. - **number**: field for entering digits. - **password**: password field, in which characters will be shielded.|
+| checked | boolean | false | No | Whether the **\** component is selected. This attribute is valid only when **type** is set to **checkbox** or **radio**. |
+| name | string | - | No | Name of the **\** component. This attribute is mandatory when **type** is set to **radio**. |
+| value | string | - | No | Value of the **\** component. When **type** is **radio**, this attribute is mandatory and the value must be unique for radio buttons with the same name.|
+| placeholder | string | - | No | Content of the hint text. This attribute is available only when the component type is set to **text** \|email\|date\|time\|number\|**password**.|
+| maxlength | number | - | No | Maximum number of characters that can be entered in the input box. The empty value indicates no limit. |
+| enterkeytype | string | default | No | Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated. Available values include: - default - next - go - done - send - search Except for the **next** type, clicking the Enter key hides the soft keyboard.|
+| headericon | string | - | No | Icon resource path before text input. This icon does not support click events and is unavailable for **button**, **checkbox**, and **radio** types. The supported icon image formats are JPG, PNG, and SVG.|
+| showcounter5+ | boolean | false | No | Whether to display the character counter for an input box. This attribute takes effect only when **maxlength** is set. |
+| menuoptions5+ | Array<MenuOption> | - | No | Menu options displayed after users click the **More** button. |
+| autofocus6+ | boolean | false | No | Whether to automatically obtain focus. This attribute setting does not take effect on the application home page. You can enable a text box on the home page to automatically obtain focus, by delaying the **focus** method call (for about 100–500 ms) in **onActive**.|
+| selectedstart6+ | number | -1 | No | Start position for text selection. |
+| selectedend6+ | number | -1 | No | End position for text selection. |
+| softkeyboardenabled6+ | boolean | true | No | Whether to display the soft keyboard during editing. |
+| showpasswordicon6+ | boolean | true | No | Whether to display the icon at the end of the password text box. This attribute is available only when **type** is set to **password**. |
**Table 1** MenuOption5+
-| Name | Type | Description |
-| ------- | ------ | ----------------------------------- |
-| icon | string | Path of the icon for a menu option. |
-| content | string | Text content of a menu option. |
+| Name | Type | Description |
+| ------- | ------ | ----------- |
+| icon | string | Path of the icon for a menu option.|
+| content | string | Text content of a menu option.|
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
-| Name | Type | Default Value | Mandatory | Description |
-| ------------------------ | ---------------- | ------------- | --------- | ---------------------------------------- |
-| color | <color> | \#e6000000 | No | Font color of the single-line text box or button. |
-| font-size | <length> | 16px | No | Font size of the single-line text box or button. |
-| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart. |
-| placeholder-color | <color> | \#99000000 | No | Color of the hint text in the single-line text box. This attribute is available only when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
-| font-weight | number \| string | normal | No | Font weight of the single-line text box or button. For details, see **font-weight** of the [**\**](../arkui-js/js-components-basic-text.md) component. |
-| caret-color6+ | <color> | - | No | Color of the caret. |
+| Name | Type | Default Value | Mandatory | Description |
+| ------------------------ | -------------------------- | ---------- | ---- | ---------------------------------------- |
+| color | <color> | \#e6000000 | No | Font color of the single-line text box or button. |
+| font-size | <length> | 16px | No | Font size of the single-line text box or button. |
+| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
+| placeholder-color | <color> | \#99000000 | No | Color of the hint text in the single-line text box. This attribute is available only when the component type is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
+| font-weight | number \| string | normal | No | Font weight of the single-line text box or button. For details, see **font-weight** of the [**\**](../arkui-js/js-components-basic-text.md) component. |
+| caret-color6+ | <color> | - | No | Color of the caret. |
## Events
@@ -66,27 +66,27 @@ In addition to the [universal events](../arkui-js/js-components-common-events.md
- When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the following events are supported.
- | Name | Parameter | Description |
+ | Name | Parameter | Description |
| ------------------------- | ---------------------------------------- | ---------------------------------------- |
- | change | { value: inputValue } | Triggered when the content entered in the input box changes. The most recent content entered by the user is returned. If you change the **value** attribute directly, this event will not be triggered. |
- | enterkeyclick | { value: enterKey } | Triggered when the **Enter** key on the soft keyboard is clicked. The type of the **Enter** key is returned, which is of the number type. Available values are as follows: - **2**: returned if **enterkeytype** is **go**. - **3**: returned if **enterkeytype** is **search**. - **4**: returned if **enterkeytype** is **send**. - **5**: returned if **enterkeytype** is **next**. - **6**: returned if **enterkeytype** is **default**, **done**, or is not set. |
- | translate5+ | { value: selectedText } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned. |
- | share5+ | { value: selectedText } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned. |
- | search5+ | { value: selectedText } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned. |
- | optionselect5+ | { index: optionIndex, value: selectedText } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned. |
- | selectchange6+ | { start: number, end: number } | Triggered when the text selection changes. |
+ | change | { value: inputValue } | Triggered when the content entered in the input box changes. The most recent content entered by the user is returned. If you change the **value** attribute directly, this event will not be triggered.|
+ | enterkeyclick | { value: enterKey } | Triggered when the **Enter** key on the soft keyboard is clicked. The type of the **Enter** key is returned, which is of the number type. Available values are as follows: - **2**: returned if **enterkeytype** is **go**. - **3**: returned if **enterkeytype** is **search**. - **4**: returned if **enterkeytype** is **send**. - **5**: returned if **enterkeytype** is **next**. - **6**: returned if **enterkeytype** is **default**, **done**, or is not set.|
+ | translate5+ | { value: selectedText } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned.|
+ | share5+ | { value: selectedText } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned.|
+ | search5+ | { value: selectedText } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned.|
+ | optionselect5+ | { index: optionIndex, value: selectedText } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned.|
+ | selectchange6+ | { start: number, end: number } | Triggered when the text selection changes. |
- When **type** is set to **checkbox** or **radio**, the following events are supported.
- | Name | Parameter | Description |
- | ------ | --------------------------------- | ---------------------------------------- |
- | change | { checked:true \| false } | Triggered when the checked status of the **checkbox** or **radio** button changes. |
+ | Name | Parameter | Description |
+ | ------ | ---------------------------------------- | ---------------------------------------- |
+ | change | { checked:true \| false } | Triggered when the checked status of the **checkbox** or **radio** button changes.|
## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
-| Name | Parameter | Description |
+| Name | Parameter | Description |
| ------------------- | ---------------------------------------- | ---------------------------------------- |
| focus | { focus: true\|false }: If **focus** is not passed, the default value **true** is used. | Obtains or loses focus. When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the input method can be displayed or collapsed. |
| showError | { error: string } | Displays the error message. This method is available when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
@@ -102,38 +102,40 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
headericon="/common/search.svg" placeholder="Please input text" onchange="change"
onenterkeyclick="enterkeyClick">
-
+
```
```css
/* xxx.css */
.content {
- width: 60%;
+ width: 100%;
flex-direction: column;
align-items: center;
}
.input {
+ width: 60%;
placeholder-color: gray;
}
.button {
+ width: 60%;
background-color: gray;
margin-top: 20px;
- }
+ }
```
-
+
```js
// xxx.js
- import prompt from '@system.prompt'
+ import promptAction from '@ohos.promptAction'
export default {
change(e){
- prompt.showToast({
+ promptAction.showToast({
message: "value: " + e.value,
duration: 3000,
});
},
enterkeyClick(e){
- prompt.showToast({
+ promptAction.showToast({
message: "enterkey clicked",
duration: 3000,
});
@@ -143,11 +145,11 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
error: 'error text'
});
},
- }
+ }
```

-
+
2. Common button
```html
@@ -190,10 +192,10 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
```js
// xxx.js
- import prompt from '@system.prompt'
+ import promptAction from '@ohos.promptAction'
export default {
checkboxOnChange(e) {
- prompt.showToast({
+ promptAction.showToast({
message:'checked: ' + e.checked,
duration: 3000,
});
@@ -225,11 +227,11 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
```js
// xxx.js
- import prompt from '@system.prompt'
+ import promptAction from '@ohos.promptAction'
export default {
onRadioChange(inputValue, e) {
if (inputValue === e.value) {
- prompt.showToast({
+ promptAction.showToast({
message: 'The chosen radio is ' + e.value,
duration: 3000,
});
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-label.md b/en/application-dev/reference/arkui-js/js-components-basic-label.md
index 3adcd954efec63b002f90f923cd8fe5b5dfdd500..9a45521ecb6ed4d614ab43abafdcd6317c31530a 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-label.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-label.md
@@ -35,8 +35,8 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| font-size | <length> | 30px | No | Font size. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. For details about how to make the configuration take effect dynamically, see the **config-changes** attribute in the **config.json** file.|
| letter-spacing | <length> | 0px | No | Character spacing (px). |
-| font-style | string | normal | No | Font style. Available values are as follows: - **normal**: standard font style - **italic**: italic font style|
-| font-weight | number \| string | normal | No | Font width. For the number type, the value ranges from 100 to 900. The default value is 400. A larger value indicates a larger font width. The value of the number type must be an integer multiple of 100. The value of the string type can be **lighter**, **normal**, **bold**, or **bolder**.|
+| font-style | string | normal | No | Font style. Available values are as follows: - **normal**: standard font style. - **italic**: italic font style.|
+| font-weight | number \| string | normal | No | Font weight. For the number type, the value ranges from 100 to 900. The default value is 400. A larger value indicates a heavier font weight. The value of the number type must be an integer multiple of 100. The value of the string type can be **lighter**, **normal**, **bold**, or **bolder**.|
| text-decoration | string | none | No | Text decoration. Available values are as follows: - **underline**: An underline is used. - **line-through**: A strikethrough is used. - **none**: The standard text is used.|
| text-align | string | start | No | Text alignment mode. Available values are as follows: - **left**: The text is left-aligned. - **center**: The text is center-aligned. - **right**: The text is right-aligned. - **start**: The text is aligned with the direction in which the text is written. - **end**: The text is aligned with the opposite direction in which the text is written. If the text width is not specified, the alignment effect may not be obvious when the text width is the same as the width of the parent container.|
| line-height | <length> | 0px | No | Text line height. When this parameter is set to **0px**, the text line height is not limited and the font size is adaptive. |
@@ -46,7 +46,7 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| min-font-size | <length> | - | No | Minimum font size in the text. This style must be used together with **max-font-size**. The font size can be changed dynamically. After the maximum and minimum font sizes are set, **font-size** does not take effect.|
| max-font-size | <length> | - | No | Maximum font size in the text. This style must be used together with **min-font-size**. The font size can be changed dynamically. After the maximum and minimum font sizes are set, **font-size** does not take effect.|
| font-size-step | <length> | 1px | No | Step for dynamically adjusting the font size in the text. The minimum and maximum font sizes must be set. |
-| prefer-font-sizes | <array> | - | No | Preset preferred font sizes. For dynamic font size adjustment, the preset sizes are used to match the maximum number of lines in the text. If the preferred font sizes were not set, the font size will be adjusted based on the maximum and minimum font sizes and the step you have set. If the maximum number of lines in the text cannot be met, **text-overflow** is used to truncate the text. If this parameter is set, **font-size**, **max-font-size**, **min-font-size**, and **font-size-step** do not take effect. Example values: **12px,14px,16px**|
+| prefer-font-sizes | <array> | - | No | Preset preferred font sizes. For dynamic font size adjustment, the preset sizes are used to match the maximum number of lines in the text. If the preferred font sizes were not set, the font size will be adjusted based on the maximum and minimum font sizes and the step you have set. If the maximum number of lines in the text cannot be met, **text-overflow** is used to truncate the text. If this parameter is set, **font-size**, **max-font-size**, **min-font-size**, and **font-size-step** do not take effect. Example: prefer-font-sizes: 12px,14px,16px|
## Events
@@ -83,7 +83,7 @@ Not supported
/*xxx.css */
.container {
flex-direction: column;
- align-items: center;
+ margin-left: 20px;
}
.row {
flex-direction: row;
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-marquee.md b/en/application-dev/reference/arkui-js/js-components-basic-marquee.md
index 9f13895436ce5f1104994f9d6956deba5e04a928..a1072111daa65e9eab0e528e086b8955efa66e09 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-marquee.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-marquee.md
@@ -37,7 +37,7 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| color | <color> | \#e5000000 | No | Font color of the scrolling text. |
| font-size | <length> | 37.5 | No | Font size of the scrolling text. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
-| font-weight | number \| string | normal | No | Font weight of the scrolling text. For details, see **font-weight** of the **[\ component](../arkui-js/js-components-basic-text.md#styles)**.|
+| font-weight | number \| string | normal | No | Font weight of the scrolling text. For details, see **font-weight** of the **[\ component](../arkui-js/js-components-basic-text.md#styles)**.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
@@ -45,17 +45,17 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
-| Name | Parameter | Description |
-| ------------ | ---- | ---------------------------------------- |
-| bounce(Rich) | - | Triggered when the marquee scrolls to the end. |
-| finish(Rich) | - | Triggered when the marquee finishes the specified number of scrollings (value of the **loop** attribute). It can be triggered only when the **loop** attribute is set to a number greater than 0.|
-| start(Rich) | - | Triggered when the marquee starts to scroll. |
+| Name | Parameter | Description |
+| ------ | ---- | ---------------------------------------- |
+| bounce | - | Triggered when the marquee scrolls to the end. |
+| finish | - | Triggered when the marquee finishes the specified number of scrollings (value of the **loop** attribute). It can be triggered only when the **loop** attribute is set to a number greater than 0.|
+| start | - | Triggered when the marquee starts to scroll. |
## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
-| Name | Parameter | Description |
+| Name | Parameter | Description |
| ----- | ---- | ----- |
| start | - | Starts scrolling.|
| stop | - | Stops scrolling.|
@@ -65,72 +65,75 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
```html
-
-
-
-
-
+
+
+
+
+
+
+
```
```css
/* xxx.css */
-.container {
+.tutorial-page {
+ width: 750px;
+ height: 100%;
flex-direction: column;
- justify-content: center;
align-items: center;
- background-color: #ffffff;
+ justify-content: center;
}
-.customMarquee {
- width: 100%;
- height: 80px;
- padding: 10px;
- margin: 20px;
- border: 4px solid #ff8888;
- border-radius: 20px;
- font-size: 40px;
- color: #ff8888;
- font-weight: bolder;
- font-family: serif;
- background-color: #ffdddd;
+.marqueetext {
+ font-size: 37px;
}
-.content {
- flex-direction: row;
+.mymarquee {
+ margin-top: 20px;
+ width:100%;
+ height: 100px;
+ margin-left: 50px;
+ margin-right: 50px;
+ border: 1px solid #dc0f27;
+ border-radius: 15px;
+ align-items: center;
}
-.controlButton {
- flex-grow: 1;
- background-color: #F2F2F2;
- text-color: #0D81F2;
+button{
+ width: 200px;
+ height: 80px;
+ margin-top: 100px;
}
```
```js
// xxx.js
export default {
- data: {
- scrollAmount: 30,
- loop: 3,
- marqueeDir: 'left',
- marqueeCustomData: 'Custom marquee',
- },
- onMarqueeBounce: function() {
- console.log("onMarqueeBounce");
+ private: {
+ loopval: 1,
+ scroll: 8,
+ color1: 'red'
},
- onMarqueeStart: function() {
- console.log("onMarqueeStart");
+ onInit(){
},
- onMarqueeFinish: function() {
- console.log("onMarqueeFinish");
+ setfinish(e) {
+ this.loopval= this.loopval + 1,
+ this.r = Math.floor(Math.random()*255),
+ this.g = Math.floor(Math.random()*255),
+ this.b = Math.floor(Math.random()*255),
+ this.color1 = 'rgba('+ this.r +','+ this.g +','+ this.b +',0.8)',
+ this.$element('testmarquee').start(),
+ this.loopval= this.loopval - 1
},
- onStartClick (evt) {
- this.$element('customMarquee').start();
+ makestart(e) {
+ this.$element('testmarquee').start()
},
- onStopClick (evt) {
- this.$element('customMarquee').stop();
+ makestop(e) {
+ this.$element('testmarquee').stop()
}
}
```
-
+
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md b/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md
index 426e227f9009c06b9e6c82f3344719c9d988e948..3f1ac6a278adeaea3059c930e3e5098fa8392374 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-picker-view.md
@@ -20,7 +20,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| ---- | ------ | ---- | ---- | ---------------------------------------- |
| type | string | text | No | Type of the scrollable selector, which cannot be changed dynamically. Available values are as follows: - **text**: text selector. - **time**: time selector. - **date**: date selector. - **datetime**: date and time selector. - **multi-text**: multi-column text selector.|
-Text selector (**type** is **text**)
+### Text Selector
| Name | Type | Default Value | Mandatory | Description |
| --------------- | ------ | ---- | ---- | ---------------------------------------- |
@@ -29,15 +29,15 @@ Text selector (**type** is **text**)
| indicatorprefix | string | - | No | Prefix field added when a value is specified for the text selector. |
| indicatorsuffix | string | - | No | Suffix field added when a value is specified for the text selector. |
-Time selector (**type** is **time**)
+### Time Selector
| Name | Type | Default Value | Mandatory | Description |
| ------------- | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| containsecond | boolean | false | No | Whether seconds are contained. |
| selected | string | Current time | No | Default value of the time selector, in the format of HH:mm. If seconds are contained, the format is HH:mm:ss.|
-| hours | number | 241-4 | No | Time format used by the time selector. Available values are as follows: - **12**: displayed in 12-hour format and distinguished by a.m. and p.m. - **24**: displayed in 24-hour format. Since API version 5, the default value is the most commonly-used hour format in the current locale.|
+| hours | number | 241-4 -5+ | No | Time format used by the time selector. Available values are as follows: - **12**: displayed in 12-hour format and distinguished by a.m. and p.m. - **24**: displayed in 24-hour format. Since API version 5, the default value is the most commonly-used hour format in the current locale.|
-Date selector (**type** is **date**)
+### Date Selector
| Name | Type | Default Value | Mandatory | Description |
| ------------------ | ------------ | ---------- | ---- | ---------------------------------------- |
@@ -47,16 +47,16 @@ Date selector (**type** is **date**)
| lunar5+ | boolean | false | No | Whether the pop-up window displays the lunar calendar. |
| lunarswitch | boolean | false | No | Whether to display the lunar calendar switch in the date selector. When this switch is displayed, the user can switch between the lunar calendar and Gregorian calendar. Turn on the switch to display the lunar calendar, and turn off the switch to hide the lunar calendar.|
-Date and time selector (**type** is **datetime**)
+### Date and Time Selector
| Name | Type | Default Value | Mandatory | Description |
| ------------------ | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| selected | string | Current date and time | No | Default value of the date and time selector. The value can be in the format of MM-DD-HH-mm or YYYY-MM-DD-HH-mm. If the year is not set, the current year is used by default. The value you set is the date selected by default in the pop-up window.|
-| hours | number | 241-4 | No | Time format used by the date and time selector. Available values are as follows: - **12**: displayed in 12-hour format and distinguished by a.m. and p.m. - **24**: displayed in 24-hour format. Since API version 5, the default value is the most commonly-used hour format in the current locale.|
+| hours | number | 241-4 -5+ | No | Time format used by the date and time selector. Available values are as follows: - **12**: displayed in 12-hour format and distinguished by a.m. and p.m. - **24**: displayed in 24-hour format. Since API version 5, the default value is the most commonly-used hour format in the current locale.|
| lunar5+ | boolean | false | No | Whether the pop-up window displays the lunar calendar. |
| lunarswitch | boolean | false | No | Whether to display the lunar calendar switch in the date and time selector. When this switch is displayed, the user can switch between the lunar calendar and Gregorian calendar. Turn on the switch to display the lunar calendar, and turn off the switch to hide the lunar calendar.|
-Multi-column text selector (**type** is **multi-text**)
+### Multi-Column Text Selector
| Name | Type | Default Value | Mandatory | Description |
| -------- | ------- | --------- | ---- | ---------------------------------------- |
@@ -77,42 +77,42 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| selected-font-size | <length> | 20px | No | Font size of the selected item. The value is of the length type, in pixels. |
| disappear-color5+ | <color> | \#ffffff | No | Font color of the items that gradually disappear. Disappearing items are the top option and bottom option of a column containing five options in total. |
| disappear-font-size5+ | <length> | 14px | No | Font size of the items that gradually disappear. Disappearing items are the top option and bottom option of a column containing five options in total. |
-| font-family | string | sans-serif | No | Font family of the selector, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
+| font-family | string | sans-serif | No | Font family of the selector, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text. |
## Events
The following events are supported.
-Text selector (**type** is **text**)
+### Text Selector
| Name | Parameter | Description |
| ------ | ---------------------------------------- | --------------- |
-| change | { newValue: newValue, newSelected: newSelected } | Triggered when a value is specified for the text selector.|
+| change | { newValue: newValue, newSelected: newSelected } | Triggered when a value is specified for the text selector.|
-Time selector (**type** is **time**)
+### Time Selector
| Name | Parameter | Description |
| ------ | ---------------------------------------- | ------------------------------- |
-| change | { hour: hour, minute: minute, [second:second]} | Triggered when a value is specified for the time selector. If seconds are contained, the value contains hour, minute, and second.|
+| change | { hour: hour, minute: minute, [second:second]} | Triggered when a value is specified for the time selector. If seconds are contained, the value contains hour, minute, and second.|
-Date selector (**type** is **date**)
+### Date Selector
| Name | Parameter | Description |
| ------ | ---------------------------------------- | --------------- |
-| change | { year:year, month:month, day:day } | Triggered when a value is specified for the date selector.|
+| change | { year:year, month:month, day:day } | Triggered when a value is specified for the date selector.|
-Date and time selector (**type** is **datetime**)
+### Date and Time Selector
| Name | Parameter | Description |
| ------ | ---------------------------------------- | ----------------- |
-| change | { year:year, month:month, day:day, hour:hour, minute:minute } | Triggered when a value is specified for the date and time selector.|
+| change | { year:year, month:month, day:day, hour:hour, minute:minute } | Triggered when a value is specified for the date and time selector.|
-Multi-text selector (**type** is **multi-text**)
+### Multi-Column Text Selector
| Name | Parameter | Description |
| ------------ | ---------------------------------------- | ---------------------------------------- |
-| columnchange | { column:column, newValue:newValue, newSelected:newSelected } | Triggered when the value of a column in the multi-column selector changes. **column**: column whose value has changed. **newValue**: selected value. **newSelected**: index of the selected value.|
+| columnchange | { column:column, newValue:newValue, newSelected:newSelected } | Triggered when the value of a column in the multi-column selector changes. **column**: column whose value has changed. **newValue**: selected value. **newSelected**: index of the selected value.|
## Methods
@@ -121,67 +121,252 @@ Not supported
## Example
-
-```html
-
-
+ ```
+
+ ```css
+ /* xxx.css */
+ .container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ left: 0px;
+ top: 0px;
+ width: 500px;
+ height: 454px;
+ }
+ .title {
+ font-size: 30px;
+ text-align: center;
+ margin-top: 20px;
+ }
+ ```
+
+ ```js
+ /* xxx.js */
+ export default {
+ data: {
+ multitext: [
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+ ],
+ value: ""
+ },
+ handleChange(data) {
+ this.value = "Column: " + data.column + "," + "Value: " + data.newValue + ", Index:" + data.newSelected;
+ },
+ }
+ ```
+ 
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-picker.md b/en/application-dev/reference/arkui-js/js-components-basic-picker.md
index f6425d937129086d130562d8454da03bcaef3c87..5a9ace889f60ae6f6c0c891e8d0a8d55b3dadfd1 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-picker.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-picker.md
@@ -58,7 +58,7 @@ When **type** is set to **time**, a time selector is used.
| Name | Type | Default Value | Mandatory | Description |
| ------------- | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| containsecond | boolean | false | No | Whether seconds are contained. |
-| selected | string | Current time | No | Default value of the time selector, in format of HH:mm. If seconds are contained, the format is HH:mm:ss. |
+| selected | string | Current time | No | Default value of the time selector, in format of HH:mm. If seconds are contained, the format is HH:mm:ss. |
| value | string | - | No | Value of the time selector. |
| hours | number | 241-4 -5+ | No | Time format used by the time selector. Available values are as follows: - **12**: displayed in 12-hour format and distinguished by a.m. and p.m. - **24**: displayed in 24-hour format. Since API version 5, the default value is the most commonly-used hour format in the current locale.|
@@ -166,52 +166,59 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
```html
-
+
+
+
+
+
+
+
+
+
```
```css
/* xxx.css */
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
}
- picker{
- width:60%;
- height:80px;
- border-radius:20px;
- text-color:white;
- font-size:15px;
- background-color:#4747e3;
- margin-left:20%;
+
+picker {
+ width: 60%;
+ height: 80px;
+ border-radius: 20px;
+ text-color: white;
+ font-size: 15px;
+ background-color: #4747e3;
+ margin-left: 20%;
}
- select{
- background-color: #efecec;
- height: 50px;
- width: 60%;
- margin-left: 20%;
- margin-top: 300px;
- margin-bottom: 50px;
- font-size: 22px;
+
+select {
+ background-color: #efecec;
+ height: 50px;
+ width: 60%;
+ margin-left: 20%;
+ margin-top: 300px;
+ margin-bottom: 50px;
+ font-size: 22px;
}
```
@@ -219,72 +226,96 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
// xxx.js
import router from '@system.router';
import prompt from '@system.prompt';
+
export default {
- data: {
- selectList:["text","data","time","datetime","multitext"],
- rangetext:['15', "20", "25"],
- multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"], ["k", "l", "m"]],
- textvalue:'default textvalue',
- datevalue:'default datevalue',
- timevalue:'default timevalue',
- datetimevalue:'default datetimevalue',
- multitextvalue:'default multitextvalue',
- containsecond:true,
- multitextselect:[1,2,0],
- datetimeselect:'2012-5-6-11-25',
- timeselect:'11:22:30',
- dateselect:'2021-3-2',
- textselect:'2'
- },
- selectChange(e){
- for(let i = 0;i** component is used to generate and display a QR code.
-
> **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
+The **\** component is used to generate and display a QR code.
## Required Permissions
@@ -24,7 +23,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| Name | Type | Default Value | Mandatory | Description |
| ----- | ------ | ---- | ---- | ---------------------------------------- |
| value | string | - | Yes | Content used to generate the QR code. |
-| type | string | rect | No | QR code type. Available values are as follows: - **rect**: rectangular QR code - **circle**: round QR code|
+| type | string | rect | No | QR code type. Available values are as follows: - **rect**: rectangular QR code. - **circle**: round QR code.|
## Styles
@@ -60,8 +59,6 @@ The [universal methods](../arkui-js/js-components-common-methods.md) are support
@@ -139,7 +139,7 @@ button{
```js
// xxx.js
-import prompt from '@system.prompt';
+import promptAction from '@ohos.promptAction';
export default{
data:{
animation:'',
@@ -162,19 +162,19 @@ export default{
this.animation = this.$element('idName').animate(frames, options);
// handle finish event
this.animation.onfinish = function(){
- prompt.showToast({
+ promptAction.showToast({
message: "The animation is finished."
});
};
// handle cancel event
this.animation.oncancel = function(){
- prompt.showToast({
+ promptAction.showToast({
message: "The animation is canceled."
});
};
// handle repeat event
this.animation.onrepeat = function(){
- prompt.showToast({
+ promptAction.showToast({
message: "The animation is repeated."
});
};
diff --git a/en/application-dev/reference/arkui-js/js-components-common-styles.md b/en/application-dev/reference/arkui-js/js-components-common-styles.md
index 2c61ed94f1317ccbd3e429b6bc2a3516db28f337..611529aec1de7dc133ff4fab8c784622cb60591a 100644
--- a/en/application-dev/reference/arkui-js/js-components-common-styles.md
+++ b/en/application-dev/reference/arkui-js/js-components-common-styles.md
@@ -9,61 +9,61 @@ You can set universal styles for components in the **style** attribute or **.css
| Name | Type | Default Value | Description |
| ---------------------------------------- | ---------------------------------------- | ------------ | ---------------------------------------- |
-| width | <length> \| <percentage> | - | Component width. If this attribute is not set, the width required for the element content is used. |
-| height | <length> \| <percentage> | - | Component height. If this attribute is not set, the height required for the element content is used. |
+| width | <length> \| <percentage> | - | Component width. If this attribute is not set, the width required for the element content is used. |
+| height | <length> \| <percentage> | - | Component height. If this attribute is not set, the height required for the element content is used. |
| min-width5+ | <length> \| <percentage>6+ | 0 | Minimum component width. |
| min-height5+ | <length> \| <percentage>6+ | 0 | Minimum component height. |
| max-width5+ | <length> \| <percentage>6+ | - | Maximum component width, which has no restriction by default. |
| max-height5+ | <length> \| <percentage>6+ | - | Maximum component height, which has no restriction by default. |
| padding | <length> \| <percentage>5+ | 0 | Shorthand attribute to set the padding for all sides in a declaration. The attribute can have one to four values: - If you set only one value, it specifies the padding for all the four sides. - If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding. - If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding. - If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).|
-| padding-[left \| top \| right \| bottom] | <length> \| <percentage>5+ | 0 | Left, top, right, and bottom padding. |
-| padding-[start \| end] | <length> \| <percentage>5+ | 0 | Start and end padding. |
+| padding-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | Left, top, right, and bottom padding. |
+| padding-[start\|end] | <length> \| <percentage>5+ | 0 | Start and end padding. |
| margin | <length> \| <percentage>5+ | 0 | Shorthand attribute to set the margin for all sides in a declaration. The attribute can have one to four values: - If you set only one value, it specifies the margin for all the four sides. - If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins. - If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin. - If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).|
-| margin-[left \| top \| right \| bottom] | <length> \| <percentage>5+ | 0 | Left, top, right, and bottom margins. |
-| margin-[start \| end] | <length> \| <percentage>5+ | 0 | Start and end margins. |
+| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | Left, top, right, and bottom margins. |
+| margin-[start\|end] | <length> \| <percentage>5+ | 0 | Start and end margins. |
| border | - | 0 | Shorthand attribute to set all borders. Set **border-width**, **border-style**, and **border-color** in sequence. Default values are used for attributes that are not set.|
| border-style | string | solid | Shorthand attribute to set the style for all borders. Available values are as follows: - **dotted**: dotted border. The radius of a dot is half of **border-width**. - **dashed**: dashed border. - **solid**: solid border.|
| border-[left\|top\|right\|bottom]-style | string | solid | Styles of the left, top, right, and bottom borders. The available values are **dotted**, **dashed**, and **solid**.|
-| border-[left \| top \| right \| bottom] | - | - | Shorthand attribute to set the borders for every side respectively. Set **border-width**, **border-style**, and **border-color** in sequence. Default values are used for attributes that are not set.|
+| border-[left\|top\|right\|bottom] | - | - | Shorthand attribute to set the borders for every side respectively. Set **border-width**, **border-style**, and **border-color** in sequence. Default values are used for attributes that are not set.|
| border-width | <length> | 0 | Shorthand attribute to set the width for all borders, or separately set the width for each border. |
-| border-[left \| top \| right \| bottom]-width | <length> | 0 | Attribute to set widths of left, top, right, and bottom borders. |
+| border-[left\|top\|right\|bottom]-width | <length> | 0 | Attribute to set widths of left, top, right, and bottom borders. |
| border-color | <color> | black | Shorthand attribute to set the color for all borders, or separately set the color for each border. |
-| border-[left \| top \| right \| bottom]-color | <color> | black | Attribute to set colors for left, top, right, and bottom borders. |
-| border-radius | <length> | - | Attribute to set the radius for round borders of an element. This attribute cannot be used to set the width, color, or style of a specific border. To set the width or color, you need to set **border-width**, **border-color**, or **border-style** for all the borders at the same time.|
-| border-[top \| bottom]-[left \| right]-radius | <length> | - | Attribute to respectively set the radii of upper-left, upper-right, lower-right, and lower-left rounded corners |
+| border-[left\|top\|right\|bottom]-color | <color> | black | Attribute to set colors for left, top, right, and bottom borders. |
+| border-radius | <length> | - | Attribute to set the radius for round borders of an element. This attribute cannot be used to set the width, color, or style of a specific border. To set the width or color, you need to set **border-width**, **border-color**, or **border-style** for all the borders at the same time. In the four-value syntax, the values apply to lower-left corner, lower-right corner, upper-left corner, and upper-right corner, respectively.|
+| border-[top\|bottom]-[left\|right]-radius | <length> | - | Attribute to respectively set the radii of upper-left, upper-right, lower-right, and lower-left rounded corners |
| background | <linear-gradient> | - | Background. This attribute supports [gradient styles](../arkui-js/js-components-common-gradient.md) only and is not compatible with **background-color** or **background-image**.|
| background-color | <color> | - | Background color. |
| background-image | string | - | Background image. Both online and local image resources are supported. Currently, this attribute is not compatible with **background-color** or **background**. Example: - background-image: url("/common/background.png") The SVG format is not supported.|
-| background-size | - string - <length> <length> - <percentage> <percentage> | auto | Background image size. - The **string** values are as follows: - **contain**: Expands the image to the maximum size so that its height and width are fully applicable to the content area. - **cover**: Extends the background image to a large enough size so that it completely covers the background area. Some parts of the image may not be displayed in the background area. - **auto**: Retains the original aspect ratio of the image. - The two **\** values are as follows: Width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default. - The two **\** values are as follows: Width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default.|
-| background-repeat | string | repeat | How a background image is repeatedly drawn. By default, a background image is repeated both horizontally and vertically. - **repeat**: The image is repeated along the x-axis and y-axis at the same time. - **repeat-x**: The image is repeated along the x-axis. - **repeat-y**: The image is repeated along the y-axis. - **no-repeat**: The image is not repeated.|
-| background-position | - string string - <length> <length> - <percentage> <percentage> | 0px 0px | - Using keywords: If only one keyword is specified, the other value is **center** by default. The two values define the horizontal position and vertical position, respectively. - **left**: leftmost in the horizontal direction. - **right**: rightmost in the horizontal direction. - **top**: top in the vertical direction. - **bottom**: bottom in the vertical direction. - **center**: center position. - Using **\**: The first value indicates the horizontal position, and the second value indicates the vertical position. For the upper left corner, the value is **0 0**. The unit is pixel. If only one value is specified, the other one is **50%**. - Using **\**: The first value indicates the horizontal position, and the second value indicates the vertical position. **0% 0%** indicates the upper left corner. **100% 100%** indicates the lower right corner. If only one value is specified, the other one is **50%**. - Using both **\** and **\**. |
-| box-shadow5+ | string | 0 | Syntax: **box-shadow: h-shadow v-shadow blur spread color** Shadow style of the current component. The value includes the horizontal position (mandatory), vertical position (mandatory), fuzzy radius (optional, default value: **0**), extension distance (optional, default value: **0**), and color (optional, default value: **black**) of the shadow. Example: - box-shadow :10px 20px 5px 10px \#888888 - box-shadow :100px 100px 30px red - box-shadow :-100px -100px 0px 40px |
-| filter5+ | string | - | Syntax: **filter: blur(px)** Radius of the blur area within the component layout. If this style is not set, the default value **0** (no blur) is used. Percentage values are not supported. Example: - filter: blur(10px) |
-| backdrop-filter5+ | string | - | Syntax: **backdrop-filter: blur(px)** Radius of the background blur area within the component layout. If this style is not set, the default value **0** (no blur) is used. Percentage values are not supported. Example: - backdrop-filter: blur(10px) |
-| window-filter5+ | string | - | Syntax: window-filter: blur(percent), style5+ Blur degree and style for windows within the component layout. If this style is not set, the default value **0%** (no blur area) is used. Different blur degrees and styles for multiple blur areas are not supported. Available blur styles are as follows: **small_light** (default value), **medium_light**, **large_light**, **xlarge_light**, **small_dark**, **medium_dark**, **large_dark**, and **xlarge_dark**. Example: - window-filter: blur(50%) - window-filter: blur(10%), large_light |
+| background-size | - string - <length> <length> - <percentage> <percentage> | auto | Background image size. - The available values of the **string** type are as follows: - **contain**: extends the image to the maximum size so that its height and width are fully applicable to the content area. - **cover**: extends the background image to a large enough size so that it completely covers the background area. Some parts of the image may not be displayed in the background area. - **auto**: retains the original aspect ratio of the image. - Values of the **\** type: The two values are width and height of the background image. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default. - Values of the **\** type: The two values are width and height of the background image in percentage of the parent element. The first value indicates the width, and the second value indicates the height. If you only set one value, the other value is set to **auto** by default.|
+| background-repeat | string | repeat | How a background image is repeatedly drawn. By default, a background image is repeated both horizontally and vertically. - **repeat**: The image is repeated along both the x-axis and y-axis. - **repeat-x**: The image is repeated along the x-axis. - **repeat-y**: The image is repeated along the y-axis. - **no-repeat**: The image is not repeated.|
+| background-position | - string string - <length> <length> - <percentage> <percentage> | 0px 0px | - Values of the **string** type: If only one value is specified, the other value is **center** by default. The two values define the horizontal position and vertical position, respectively. - **left**: leftmost in the horizontal direction. - **right**: rightmost in the horizontal direction. - **top**: top in the vertical direction. - **bottom**: bottom in the vertical direction. - **center**: center in the horizontal or vertical direction. - Values of the **\** type: The first value indicates the horizontal position, and the second value indicates the vertical position. For the upper left corner, the value is 0 0 in px (**0px 0px**). If only one value is specified, the other one is **50%**. - Values of the **\** type: The first value indicates the horizontal position, and the second value indicates the vertical position. For the upper left corner, the value is 0% 0%. For the lower right corner, the value is **100% 100%**. If only one value is specified, the other one is **50%**. - Values of the **\** type and **\** type can be used together.|
+| box-shadow5+ | string | 0 | Syntax: box-shadow: h-shadow v-shadow blur spread color Shadow style of the current component. The value includes the horizontal position (mandatory), vertical position (mandatory), fuzzy radius (optional, default value: **0**), extension distance (optional, default value: **0**), and color (optional, default value: **black**) of the shadow. Example: - box-shadow :10px 20px 5px 10px \#888888 - box-shadow :100px 100px 30px red - box-shadow :-100px -100px 0px 40px |
+| filter5+ | string | - | Syntax: filter: blur(px) Radius of the blur area within the component layout. If this style is not set, the default value **0** (no blur) is used. Percentage values are not supported. Example: - filter: blur(10px) |
+| backdrop-filter5+ | string | - | Syntax: backdrop-filter: blur(px) Radius of the background blur area within the component layout. If this style is not set, the default value **0** (no blur) is used. Percentage values are not supported. Example: - backdrop-filter: blur(10px) |
+| window-filter5+ | string | - | Syntax: window-filter: blur(percent), style5+ Blur degree and style for windows within the component layout. If this style is not set, the default value **0%** (no blur area) is used. Different blur degrees and styles for multiple blur areas are not supported. Available values of **style** are as follows: small_light (default value), medium_light, large_light, xlarge_light, small_dark, medium_dark, large_dark, xlarge_dark Example: - window-filter: blur(50%) - window-filter: blur(10%), large_light |
| opacity | number | 1 | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. |
-| display | string | flex | Type of the box containing an element. Available values are as follows: - **flex**: Flexible layout. - **none**: The box is disabled. - **inline**9+: Inline box, where the element is displayed as an inline element and does not start on a new line. - **block**9+: Block box, where the element is displayed as a block-level element and always starts on a new line. This is the default value for container components. - **inline-block**9+: Inline-block box, where the element is displayed on one line and you can set a width and height on the element. This is the default value for basic components.|
+| display | string | flex | Type of the box containing an element. Available values are as follows: - **flex**: flexible layout - **none**: not rendered - **grid**: grid layout (available only for the **\
** component) |
| visibility | string | visible | Whether to display the box containing an element. The invisible box occupies layout space. (To remove the box, set the **display** attribute to **none**.) Available values are as follows: - **visible**: The element is visible. - **hidden**: The box is hidden but still takes up space. If both **visibility** and **display** are set, only **display** takes effect.|
| flex | number \| string | - | How to divide available space of the parent component for each child component. You can set one, two5+, or three5+ values for this style. Set one value in either of the following ways: - A unitless number to set **flex-grow**. - A valid width value5+ to set **flex-basis**. Set two values5+ in the following ways: The first value must be a unitless number used to set **flex-grow**. The second value must be either of the following: - A unitless number to set **flex-shrink**. - A valid width value to set **flex-basis**. Set three values5+ in the following ways: The first value must be a unitless number used to set **flex-grow**. The second value must be a unitless number used to set **flex-shrink**. The third value must be a valid width value used to set **flex-basis**. This style takes effect only when the container is any of the following components: **\
**, **\**, **\**, **\**, and **\5+**.|
| flex-grow | number | 0 | How much a child component will grow. The value specifies allocation of the remaining space on the main axis of the parent component. Size of available space = Container size - Total size of all child components. Value **0** indicates that the child component does not grow. This style takes effect only when the container is any of the following components: **\
**, **\**, **\**, **\**, and **\5+**.|
| flex-shrink | number | 1 | How much a child component will shrink. The shrink occurs only when the sum of default child component widths is greater than that of the parent component. Value **0** indicates that the child component does not shrink. This style takes effect only when the container is any of the following components: **\
**, **\**, **\**, **\**, and **\5+**.|
| flex-basis | <length> | - | Initial length of the flex item on the main axis. This style takes effect only when the container is any of the following components: **\
**, **\**, **\**, **\**, and **\5+**.|
-| align-self6+ | string | - | Alignment mode on the cross axis of the parent element. This style overwrites the align-items style of the parent element. The align-items style is used only in the div and list styles of the parent container. Available values are as follows: - **stretch**: Items are stretched to the same height or width as the container in the cross axis direction. - **flex-start**: Items are aligned to the start of the cross axis. - **flex-end**: Items are aligned to the end of the cross axis. - **center**: Items are aligned in the center of the cross axis. - **baseline**: Items are aligned on the peracross axis.|
-| position | string | relative | Positioning type of an element. Dynamic changes are not supported. - **fixed**: The element is positioned related to the browser window. - **absolute**: The element is positioned absolutely to its parent element. The setting takes effect only when the parent component is **\
** or **\**. - **relative**: The element is positioned relative to its normal position.|
-| [left \| top \| right \| bottom] | <length> \| <percentage>6+ | - | **left | top | right | bottom** must be used together with **position** to determine the offset of an element. - The **left** attribute specifies the left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block. - The **top** attribute specifies the top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element. - The **right** attribute specifies the right edge position of the element. This attribute defines the offset between the right edge of a positioned element and that of a block included in the element. - The **bottom** attribute specifies the bottom edge position of the element. This attribute defines the offset between the bottom edge of a positioned element and that of a block included in the element. |
-| [start \| end]6+ | <length> \| <percentage> | - | **start | end** must be used together with **position** to determine the offset of an element. - The **start** attribute specifies the start edge position of the element. This attribute defines the offset between the start edge of a positioned element and that of a block included in the element. - The **end** attribute specifies the end edge position of the element. This attribute defines the offset between the end edge of a positioned element and that of a block included in the element. |
+| align-self6+ | string | - | How items are aligned along the main axis of the container. The setting overwrites the **align-items** setting of the container and is valid only when the container is **\
** or **\**. Available values are as follows: - **stretch**: Items are stretched to the same height or width as the container along the cross axis. - **flex-start**: Items are packed toward the start edge of the cross axis. - **flex-end**: Items are packed toward the end edge of the cross axis. - **center**: Items are packed toward the center of the cross axis. - **baseline**: Items are packed toward the baseline of the cross axis.|
+| position | string | relative | Positioning type of an element. Dynamic changes are not supported. - **fixed**: The element is positioned relative to the entire UI. - **absolute**: The element is positioned relative to the container. The setting is valid only when the container is **\
** or **\**. - **relative**: The element is positioned relative to its normal position.|
+| [left \| top \| right \| bottom] | <length> \| <percentage>6+ | - | Edge of the element. This style must be used together with **position** to determine the offset of an element. - **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block. - **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element. - **right**: right edge position of the element. This attribute defines the offset between the right edge of a positioned element and that of a block included in the element. - **bottom**: bottom edge position of the element. This attribute defines the offset between the bottom edge of a positioned element and that of a block included in the element. |
+| [start \| end]6+ | <length> \| <percentage> | - | start \| end must be used together with **position** to determine the offset of an element. - **start**: start edge position of the element. This attribute defines the offset between the start edge of a positioned element and that of a block included in the element. - **end**: end edge position of the element. This attribute defines the offset between the end edge of a positioned element and that of a block included in the element.|
| z-index6+ | number | - | Rendering sequence of child nodes under the same parent node. A child node with a larger value will be rendered later. z-index does not support auto, and other styles such as opacity do not affect the rendering sequence of z-index.|
-| image-fill6+ | <color> | - | Fill color for SVG images. The following components are supported: **button** (icon attribute), **piece** (icon attribute), **search** (icon attribute), **input** (headericon attribute), **textarea** (headericon attribute), **image** (src attribute), and **toolbar-item** (icon attribute) The **fill** color value in the SVG image file is replaced with the value of **image-fill** during rendering, and is valid only for the fill attribute that is declared in the SVG image.|
-| clip-path6+ | [ <geometry-box> \| <basic-shape> ] \| none | - | Clip area of a component. Only the content within this area is displayed. **\**: applicable scope of the clip area's width and height. The default value is **border-box**. Available values are as follows: - **margin-box**: The width and height includes the margin. - **border-box**: The width and height includes the border. - **padding-box**: The width and height includes the padding. - **content-box**: The width and height does not include any margin, border, or padding. **\**: shape of the clip area. Available values include: - **inset**, in the format of inset( \{1,4} [ round \<'border-radius'> ]? ). - **circle**, in the format of circle( [ \ ]? [ at <percentage> <percentage> ]? ). - **ellipse**, in the format of ellipse( [ \{2} ]? [ at <percentage> <percentage> ]? ). - **polygon**, in the format of polygon( [ \ \ ]\# ). - **path**, in the format of path( \ ).|
+| image-fill6+ | <color> | - | Fill color for SVG images. The following components are supported: **\
@@ -60,12 +60,12 @@ In the example below, where **PageA** jumps to **PageB**, the shared element is
```js
// xxx.js
-import router from '@system.router';
+import router from '@ohos.router';
export default {
jump() {
router.push({
// The path must be the same as that in the config.json file.
- uri: 'pages/detailpage',
+ url: 'pages/detailpage',
});
},
}
@@ -93,7 +93,7 @@ export default {
```js
// xxx.js
-import router from '@system.router';
+import router from '@ohos.router';
export default {
jumpBack() {
router.back();
@@ -117,7 +117,6 @@ export default {
## Widget Transition
> **NOTE**
->
> Widget transitions are not available when other transitions (including shared element transitions and custom transitions) are used.
@@ -125,7 +124,7 @@ export default {
| Name | Type | Default Value | Description |
| ----------------- | ------ | ---- | ---------------------------------------- |
-| transition-effect | string | - | Whether a component on the current page displays the transition effect during a widget transition. Available values are as follows: - **unfold**: The component will move upwards by one widget height if the component is located above the widget tapped by the user, or move downwards by one widget height if the component is located below the widget. - **none**: No transition effect is displayed. |
+| transition-effect | string | - | Whether a component on the current page displays the transition effect during a widget transition. Available values are as follows: - **unfold**: The component will move upwards by one widget height if the component is located above the widget tapped by the user, or move downwards by one widget height if the component is located below the widget. - **none**: No transition effect is displayed.|
### Example
@@ -140,7 +139,7 @@ The **source_page** has a title area on the top and a widget list. Users can tap
MAIN TITLE
-
+ {{$item.title}}
@@ -149,19 +148,19 @@ The **source_page** has a title area on the top and a widget list. Users can tap
```js
// xxx.js
-import router from '@system.router'
+import router from '@ohos.router'
export default {
data: { list: [] },
onInit() {
for(var i = 0; i < 10; i++) {
- var item = { uri: "pages/card_transition/target_page/index",
+ var item = { url: "pages/card_transition/target_page/index",
title: "this is title" + i, id: "item_" + i }
this.list.push(item);
}
},
- jumpPage(id, uri) {
+ jumpPage(id, url) {
var cardId = this.$element(id).ref;
- router.push({ uri: uri, params : { ref : cardId } });
+ router.push({ url: url, params : { ref : cardId } });
}
}
```
@@ -169,6 +168,8 @@ export default {
```css
/* xxx.css */
.container {
+ width: 100%;
+ height: 100%;
flex-direction: column;
align-items: center;
background-color: #ABDAFF;
@@ -199,6 +200,8 @@ export default {
```css
/* xxx.css */
.container {
+ width: 100%;
+ height: 100%;
flex-direction: column;
align-items: center;
background-color: #EBFFD7;
@@ -223,7 +226,7 @@ export default {
| -------------------------- | ------ | ------------- | ---------------------------------------- |
| transition-enter | string | - | Works with **@keyframes** and supports transform and opacity animations. For details, see [Attributes available for the @keyframes rule](../arkui-js/js-components-common-animation.md).|
| transition-exit | string | - | Works with **@keyframes** and supports transform and opacity animations. For details, see [Attributes available for the @keyframes rule](../arkui-js/js-components-common-animation.md).|
-| transition-duration | string | Follows the default page transition time of the device | The unit can be s or ms. The default unit is ms. If no value is specified, the default value is used. |
+| transition-duration | string | Follows the default page transition time of the device| The unit can be s|or ms. The default unit is ms. If no value is specified, the default value is used.|
| transition-timing-function | string | friction | Speed curve of the transition animation, which makes the animation more fluent. For details, see the description of **animation-timing-function **in [Animation Styles](../arkui-js/js-components-common-animation.md).|
@@ -255,16 +258,16 @@ export default {
```
```js
// xxx.js
- import router from '@system.router';
+ import router from '@ohos.router';
export default {
data: {
-
+
},
jumpBack() {
router.back()
@@ -346,7 +349,7 @@ export default {
width: 100%;
height: 100%;
}
-
+
.move_page {
width: 100px;
height: 100px;
@@ -356,7 +359,7 @@ export default {
transition-duration: 5s;
transition-timing-function: ease;
}
-
+
@keyframes go_page {
from {
opacity: 0;
@@ -367,7 +370,7 @@ export default {
transform:translate(100px) rotate(180deg) scale(2.0);
}
}
-
+
@keyframes exit_page {
from {
opacity: 1;
diff --git a/en/application-dev/reference/arkui-js/js-components-container-badge.md b/en/application-dev/reference/arkui-js/js-components-container-badge.md
index c0855efd572677c06214c3bd4900fbfff05a9684..cce7ddc8f052523c4f4e3bb82348196674edd788 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-badge.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-badge.md
@@ -25,14 +25,14 @@ This component supports only one child component.
In addition to the [universal attributes](js-components-common-attributes.md), the following attributes are supported.
-| Name | Type | Default Value | Mandatory | Description |
-| ------------------ | ----------- | -------- | ---- | ---------------------------------------- |
-| placement | string | rightTop | No | Position of a number or dot badge. Available values are as follows: - **right**: on the right border of the component. - **rightTop**: in the upper right corner of the component border. - **left**: on the left border of the component.|
-| count | number | 0 | No | Number of notifications displayed via the badge. The default value is **0**. If the number of notifications is greater than 0, the badge changes from a dot to the number. If this attribute is not set or the value is less than or equal to 0, the badge is a dot. When the **count** value is greater than the **maxcount** value, *maxcount***+** is displayed. The largest integer value supported for **count** is **2147483647**.|
-| visible | boolean | false | No | Whether to display the badge. The value **true** means that the badge shows up when a new notification is received. To use a number badge, set the **count** attribute.|
-| maxcount | number | 99 | No | Maximum number of notifications. When the number of new notifications exceeds the value of this attribute, *maxcount***+** is displayed, for example, **99+**. The largest integer value supported for **maxcount** is **2147483647**.|
-| config | BadgeConfig | - | No | Configuration of the badge. |
-| label6+ | string | - | No | Text of the new notification displayed via the badge. When this attribute is set, attributes **count** and **maxcount** do not take effect.|
+| Name | Type | Default Value | Mandatory| Description |
+| ------------------ | ----------- | -------- | ---- | ------------------------------------------------------------ |
+| placement | string | rightTop | No | Position of a number or dot badge. Available values are as follows: - **right**: on the right border of the component. - **rightTop**: in the upper right corner of the component border. - **left**: on the left border of the component.|
+| count | number | 0 | No | Number of notifications displayed via the badge. If the value is 0 (default value), the badge is not displayed. If the value is greater than 0, the badge is a number badge. When the **count** value is greater than the **maxcount** value, *maxcount***+** is displayed. The largest integer value supported for **count** is **2147483647**.|
+| visible | boolean | false | No | Whether to display the badge. The value **true** means that the badge shows up when a new notification is received. To use a number badge, also set the **count** attribute.|
+| maxcount | number | 99 | No | Maximum number of notifications. When the number of new notifications exceeds the value of this attribute, *maxcount***+** is displayed, for example, **99+**. The largest integer value supported for **maxcount** is **2147483647**.|
+| config | BadgeConfig | - | No | Configuration of the badge. |
+| label6+ | string | - | No | Text of the new notification displayed via the badge. When this attribute is set, attributes **count** and **maxcount** do not take effect.|
**Table 1** BadgeConfig
@@ -110,4 +110,4 @@ export default {
}
```
-
+
diff --git a/en/application-dev/reference/arkui-js/js-components-container-div.md b/en/application-dev/reference/arkui-js/js-components-container-div.md
index 9a2976b1a7b00769300795475c59a24f25364e02..e35eb42639301cfb6ce1a9a45880217ce1daf54b 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-div.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-div.md
@@ -30,9 +30,8 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| flex-direction | string | row | No | Main axis direction of the flex container, which defines how items are placed in the container. Available values are as follows: - **column**: Items are placed vertically from top to bottom. - **row**: Items are placed horizontally from left to right.|
| flex-wrap | string | nowrap | No | Whether items in the flex container are displayed in a single line or multiple lines. The value cannot be dynamically updated. Available values are as follows: - **nowrap**: Flex items are displayed in a single line. - **wrap**: Flex items are displayed in multiple lines.|
| justify-content | string | flex-start | No | How items are aligned along the main axis of the flex container. Available values are as follows: - **flex-start**: Items are packed toward the start edge of the container along the main axis. - **flex-end**: Items are packed toward the end edge of the container along the main axis. - **center**: Items are packed toward the center of the container along the main axis. - **space-between**: Items are positioned with space between the rows. - **space-around**: Items are positioned with space before, between, and after the rows. - **space-evenly**5+: Items are distributed within the container along the main axis, with even space between each two.|
-| align-items | string | stretch | No | How items are aligned along the cross axis of the flex container. Available values are as follows: - **stretch**: Items are stretched to the same height or width as the container along the cross axis. - **flex-start**: Items are packed toward the start edge of the cross axis. - **flex-end**: Items are packed toward the end edge of the cross axis. - **center**: Items are packed toward the center of the cross axis. - **baseline**: In a vertical layout, items are aligned to the start of the cross axis, which means that this value is equivalent of **flex-start**. In a horizontal layout, items are aligned with the text baseline if there is text involved, and aligned to the bottom otherwise.|
+| align-items | string | stretch | No | How items are aligned along the cross axis in a flex container. Available values are as follows: - **stretch**: Items are stretched to the same height or width as the container along the cross axis. - **flex-start**: Items are packed toward the start edge of the cross axis. - **flex-end**: Items are packed toward the end edge of the cross axis. - **center**: Items are packed toward the center of the cross axis. - **baseline**: In a vertical layout, items are aligned to the start of the cross axis, which means that this value is equivalent of **flex-start**. In a horizontal layout, items are aligned with the text baseline if there is text involved, and aligned to the bottom otherwise.|
| align-content | string | flex-start | No | Multi-row alignment mode when there is extra space in the cross axis. Available values are as follows: - **flex-start**: All rows are packed toward the start edge of the cross axis. The start edge of the cross axis of the first row is aligned with the start edge of the cross axis of the container. All subsequent rows are aligned with the previous row. - **flex-end**: All rows are packed toward the end edge of the cross axis. The end of the cross axis of the last row is aligned with the end of the cross axis of the container. All subsequent rows are aligned with the previous row. - **center**: All rows are packed toward the center of the cross axis. Rows are close to each other and aligned with the center of the container. The spacing between the start edge of the container's cross axis and the first row is equal to the spacing between the end edge of the container's cross axis and the last row. - **space-between**: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The start and end edges of the container's cross axis are aligned with the edges of the first and last rows, respectively. - **space-around**: All rows are evenly distributed in the container. The spacing between two adjacent rows is the same. The spacing between the start edge of the container's cross axis and the first row and that between the end edge and the last row are half of the spacing between two adjacent rows.|
-| display | string | flex | No | Type of the view box of the item. The value cannot be dynamically updated. Available values are as follows: - **flex**: flexible layout - **grid**: grid layout - **none**: not rendered - **inline-flex**9+: layout with the **flex** and **inline-block** effects.|
| grid-template-[columns\|rows] | string | 1 row, 1 column | No | Number of rows and columns in the current grid layout. If this attribute is not set, one row and one column are displayed by default. This attribute is valid only when **display** is set to **grid**. Below are some example values of **grid-template-columns**: - **50px 100px 60px**: There are three columns. The first column is 50 px, the second column is 100 px, and the third column is 60 px. - **1fr 1fr 2fr**: There are three columns, and the width allowed by the parent component is divided into four equal shares. The first column occupies one share, the second column occupies one share, and the third column occupies two shares. - **30% 20% 50%**: There are three columns. The first column occupies 30% of the total width allowed by the parent component, the second column occupies 20%, and the third column occupies 50%. - **repeat (2,100px)**: There are two columns. The first column is 100 px, and the second column is 100 px. - **repeat(auto-fill,100px)**5+: Each column is 100 px and repeats to fill the cross axis. The number of columns is calculated based on the column size and the cross axis size. - **auto 1fr 1fr**: There are three columns. The first column is adaptive to the width required by its child components. The remaining space is divided into two equal shares, one share occupied by each of the rest two columns.|
| grid-[columns\|rows]-gap | <length> | 0 | No | Size of the gap between two consecutive rows or columns in a grid layout. You can also use **grid-gap** to set the same size of the gap between rows and columns. This attribute is valid only when **display** is set to **grid**.|
| grid-row-[start\|end] | number | - | No | Start and end row numbers of the current item in the grid layout. This attribute is valid only when the item's parent component is a **\
** container whose **display** style is set to **grid**.|
@@ -47,6 +46,8 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
## Events
+
+
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description |
@@ -246,26 +247,28 @@ In addition to the [universal methods](js-components-common-methods.md), the fol
```html
```
@@ -370,12 +373,13 @@ In addition to the [universal methods](js-components-common-methods.md), the fol
justify-content: center;
align-items: center;
width: 454px;
- height: 454px;}
- .content{
+ height: 454px;
+ }
+ .content {
width: 400px;
height: 400px;
background-color: aqua;
- margin:30px
+ margin: 30px;
}
```
diff --git a/en/application-dev/reference/arkui-js/js-components-container-list.md b/en/application-dev/reference/arkui-js/js-components-container-list.md
index 640c6c420ce81d299b7d12a1b67cca42b543ea1b..793e037c599b70a09ef595d9ee969823f137917e 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-list.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-list.md
@@ -72,7 +72,7 @@ In addition to the [universal events](../arkui-js/js-components-common-events.md
| scrollend | - | Triggered when the list stops scrolling. |
| scrolltouchup | - | Triggered when the list continues scrolling after the user lifts their fingers. |
| requestitem | - | Triggered for a request to create a list-item. This event is triggered when the number of cached list-items outside the visible area is less than the value of **cachedcount** during long list loading with delay.|
-| rotate7+ | { rotateValue: number } | Triggered to indicate the incremental value of the rotation angle of the watch crown. This parameter is only supported by wearables. |
+| rotation7+ | { rotateValue: number } | Triggered to indicate the incremental value of the rotation angle of the watch crown. This parameter is only supported by wearables. |
## Methods
@@ -112,22 +112,6 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
```
```css
/* xxx.css */
.doc-page {
- flex-direction: column;
- justify-content: center;
- align-items: center;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
}
+
.btn-div {
- width: 100%;
- height: 200px;
- flex-direction: column;
- align-items: center;
- justify-content: center;
+ width: 100%;
+ height: 200px;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
}
+
.txt {
- color: #000000;
- font-weight: bold;
- font-size: 39px;
+ color: #000000;
+ font-weight: bold;
+ font-size: 39px;
}
+
.panel-div {
- width: 100%;
- flex-direction: column;
- align-items: center;
+ width: 100%;
+ flex-direction: column;
+ align-items: center;
}
+
.inner-txt {
- width: 100%;
- height: 160px;
- flex-direction: column;
- align-items: center;
- justify-content: center;
+ width: 100%;
+ height: 160px;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
}
+
.inner-btn {
- width: 100%;
- height: 120px;
- justify-content: center;
- align-items: center;
+ width: 100%;
+ height: 120px;
+ justify-content: center;
+ align-items: center;
}
```
diff --git a/en/application-dev/reference/arkui-js/js-components-container-popup.md b/en/application-dev/reference/arkui-js/js-components-container-popup.md
index ef1cf3c658d395c64808eb9a1743c8d67b76bd81..46d661972f887b2ed6601523198618d7a831d380 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-popup.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-popup.md
@@ -4,7 +4,7 @@
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
-Bubble indication. The **\** component is used to display a pop-up to offer instructions after a user clicks a bound control.
+The **\** component is used to display a pop-up to offer instructions after a user clicks a bound component.
## Required Permissions
@@ -116,7 +116,7 @@ export default {
visibilitychange(e) {
prompt.showToast({
message: 'visibility change visibility: ' + e.visibility,
- duration: 3000,
+ duration: 3000
});
},
showpopup() {
@@ -124,7 +124,7 @@ export default {
},
hidepopup() {
this.$element("popup").hide();
- },
+ }
}
```
diff --git a/en/application-dev/reference/arkui-js/js-components-container-refresh.md b/en/application-dev/reference/arkui-js/js-components-container-refresh.md
index 8c3d8c5f42dfeb9721e0c00b1b7a7dbb31187241..fb9bf04be32e5c4612afd0a955810bfec050ae8d 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-refresh.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-refresh.md
@@ -4,7 +4,7 @@
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
-The **** component is used to refresh a page through a pull-down gesture.
+The **** component is used to refresh a page through a pull-down gesture.
## Required Permissions
@@ -22,7 +22,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
-| offset | <length> | - | No| Distance to the top of the parent component from the **** component that comes to rest after a successful pull-down gesture.|
+| offset | <length> | - | No| Distance to the top of the parent component from the **** component that comes to rest after a successful pull-down gesture.|
| refreshing | boolean | false | No| Whether the **\** component is being used for refreshing.|
| type | string | auto | No| Dynamic effect when the component is refreshed. Two options are available and cannot be modified dynamically. - **auto**: default effect. When the list is pulled to the top, the list does not move. When the list is pulled to the bottom, a circle is displayed. - **pulldown**: When the list is pulled to the top, users can continue to pull down to trigger a refresh. The rebound effect will appear after the refresh. If the child component contains a list, set **scrolleffect** of the list to **no** to prevent drop-down effect conflicts.|
| lasttime | boolean | false | No| Whether to display the last update time. The character string format is **last update time: XXXX**, where **XXXX** is displayed based on the certain time and date formats and cannot be dynamically modified. (It is recommended that this attribute be used when **type** is set to **pulldown**. The fixed distance is at the bottom of the content drop-down area. Pay attention to the **offset** attribute setting to prevent overlapping.)|
@@ -36,8 +36,8 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
-| background-color | <color> | white | No| Background color of the **\** component.|
-| progress-color | <color> | black | No| Loading color of the **\** component.|
+| background-color | <color> | white | No| Background color of the **\** component.|
+| progress-color | <color> | black | No| Color of the loading icon of the **\** component.|
## Events
@@ -107,7 +107,7 @@ The [universal methods](../arkui-js/js-components-common-methods.md) are not sup
```js
// xxx.js
-import prompt from '@system.prompt';
+import promptAction from '@ohos.promptAction';
export default {
data: {
list:[],
@@ -121,7 +121,7 @@ export default {
}
},
refresh: function (e) {
- prompt.showToast({
+ promptAction.showToast({
message: 'Refreshing...'
})
var that = this;
@@ -130,7 +130,7 @@ export default {
that.fresh = false;
var addItem ='Refresh element';
that.list.unshift(addItem);
- prompt.showToast({
+ promptAction.showToast({
message: 'Refreshed.'
})
}, 2000)
diff --git a/en/application-dev/reference/arkui-js/js-components-container-stepper.md b/en/application-dev/reference/arkui-js/js-components-container-stepper.md
index 6a666a454cd424e1b3daf67fcae1c4a4e08f67a6..09bd2f3fce15f326b1d8f06832d3ea0c4319e234 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-stepper.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-stepper.md
@@ -27,7 +27,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| Name | Type | Default Value | Description |
| ----- | ------ | ---- | ------------------------------ |
-| index | number | - | Index of the **\** child component that is currently displayed.|
+| index | number | 0 | Index of the **\** child component to display. By default, the first one is displayed.|
## Styles
@@ -46,10 +46,10 @@ In addition to the [universal events](../arkui-js/js-components-common-events.md
| Name | Parameter | Description |
| ------ | ---------------------------------------- | ---------------------------------------- |
| finish | - | Triggered when the last step on the navigator is complete. |
-| skip | - | Triggered when users click the skip button, which works only if you have called **setNextButtonStatus** method to allow users to skip all steps.|
+| skip | - | Triggered when users click the skip button to skip steps.|
| change | { prevIndex: prevIndex, index: index} | Triggered when users click the left or right (text) button of the step navigator to switch between steps. **prevIndex** indicates the index of the previous step, and **index** indicates that of the current step.|
-| next | { index: index, pendingIndex: pendingIndex } | Triggered when users click the next (text) button. **index** indicates the index of the current step, and **pendingIndex** indicates that of the step to go. The return value is in **{pendingIndex:*** pendingIndex***}** format. You can use **pendingIndex** to specify a **\** child component as the next step to go.|
-| back | { index: index, pendingIndex: pendingIndex } | Triggered when users click the previous (text) button. **index** indicates the index of the current step, and **pendingIndex** indicates that of the step to go. The return value is in Object:{ **{pendingIndex:*** pendingIndex***}** format. You can use **pendingIndex** to specify a **\** child component as the previous step.|
+| next | { index: index, pendingIndex: pendingIndex } | Triggered when users click the next (text) button. **index** indicates the index of the current step, and **pendingIndex** indicates that of the step to go. The return value is in **{pendingIndex:*** pendingIndex***}** format. You can use **pendingIndex** to specify a **** child component as the next step to go.|
+| back | { index: index, pendingIndex: pendingIndex } | Triggered when users click the previous (text) button. **index** indicates the index of the current step, and **pendingIndex** indicates that of the step to go. The return value is in Object:{ **{pendingIndex:*** pendingIndex***}** format. You can use **pendingIndex** to specify a **** child component as the previous step.|
## Methods
@@ -58,101 +58,137 @@ In addition to the [universal methods](../arkui-js/js-components-common-methods.
| Name | Parameter | Description |
| ------------------- | ---------------------------------------- | ---------------------------------------- |
-| setNextButtonStatus | { status: string, label: label } | Sets the status of the next (text) button in this step navigator. Available **status** values are as follows: - **normal**: The next button is displayed normally and can navigate users to the next step when it is clicked. - **disabled**: The next button is grayed out and unavailable. - **waiting**: The next button is not displayed, and a process bar is displayed instead. - **skip**: The skip button is displayed to allow users to skip all remaining steps.|
+| setNextButtonStatus | { status: string, label: label } | Sets the text and status of the next button in the step navigator. **label** indicates the button text, and **status** indicates the button status. Available **status** values are as follows: - **normal**: The next button is displayed normally and can navigate users to the next step when it is clicked. - **disabled**: The next button is grayed out and unavailable. - **waiting**: The next button is not displayed, and a process bar is displayed instead. - **skip**: The skip button is displayed to allow users to skip all remaining steps.|
## Example
```html
-
-
-
-
- First screen
-
-
-
-
-
- Second screen
-
-
-
-
-
- Third screen
-
-
-
-
+
+
+
+
+ Page One
+
+
+
+
+
+ Page Two
+
+
+
+
+
+ Page Three
+
+
+
+
```
```css
/* xxx.css */
.container {
- margin-top: 20px;
- flex-direction: column;
- align-items: center;
- height: 300px;
+ flex-direction: column;
+ align-items: center;
+ height: 100%;
+ width: 100%;
+ background-color: #f7f7f7;
}
-.stepperItem {
- width: 100%;
- flex-direction: column;
- align-items: center;
+.stepper{
+ width: 100%;
+ height: 100%;
}
-.stepperItemContent {
- color: #0000ff;
- font-size: 50px;
- justify-content: center;
+.stepper-item {
+ width: 100%;
+ height: 100%;
+ flex-direction: column;
+ align-items: center;
+}
+.item{
+ width: 90%;
+ height: 86%;
+ margin-top: 80px;
+ background-color: white;
+ border-radius: 60px;
+ flex-direction: column;
+ align-items: center;
+ padding-top: 160px;
+}
+text {
+ font-size: 78px;
+ color: #182431;
+ opacity: 0.4;
}
.button {
- width: 60%;
- margin-top: 30px;
- justify-content: center;
+ width: 40%;
+ margin-top: 100px;
+ justify-content: center;
}
```
```js
// xxx.js
+import prompt from '@system.prompt';
+
export default {
- data: {
- label_1:
- {
- prevLabel: 'BACK',
- nextLabel: 'NEXT',
- status: 'normal'
- },
- label_2:
- {
- prevLabel: 'BACK',
- nextLabel: 'NEXT',
- status: 'normal'
- },
- label_3:
- {
- prevLabel: 'BACK',
- nextLabel: 'NEXT',
- status: 'normal'
- },
- },
- setRightButton(e) {
- this.$element('mystepper').setNextButtonStatus({status: 'skip', label: 'SKIP'});
- },
- nextclick(e) {
- var index = {
- pendingIndex: e.pendingIndex
- }
- return index;
- },
- backclick(e) {
- var index = {
- pendingIndex: e.pendingIndex
+ data: {
+ label_1:
+ {
+ prevLabel: 'BACK',
+ nextLabel: 'NEXT',
+ status: 'normal'
+ },
+ label_2:
+ {
+ prevLabel: 'BACK',
+ nextLabel: 'NEXT',
+ status: 'normal'
+ },
+ label_3:
+ {
+ prevLabel: 'BACK',
+ nextLabel: 'NEXT',
+ status: 'normal'
+ }
+ },
+ setRightButton(e) {
+ this.$element('mystepper').setNextButtonStatus({
+ status: 'waiting', label: 'SKIP'
+ });
+ },
+ nextclick(e) {
+ var index = {
+ pendingIndex: e.pendingIndex
+ }
+ return index;
+ },
+ backclick(e) {
+ var index = {
+ pendingIndex: e.pendingIndex
+ }
+ return index;
+ },
+ statuschange(e) {
+ prompt.showToast({
+ message: 'Previous step index' + e.prevIndex + 'Current step index' + e.index
+ })
+ },
+ finish() {
+ prompt.showToast({
+ message:'Finished.'
+ })
+ },
+ skip() {
+ prompt.showToast({
+ message: 'Skip triggered'
+ })
}
- return index;
- },
}
```
-
+
diff --git a/en/application-dev/reference/arkui-js/js-components-container-swiper.md b/en/application-dev/reference/arkui-js/js-components-container-swiper.md
index e0edf4c40ffba747e84e1dc84e8999993bca675e..f607139653a52a1e1edbca359ca60d7224ebcc30 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-swiper.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-swiper.md
@@ -4,7 +4,7 @@
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
-The **\** component provides a container that allows users to switch among child components using swipe gestures.
+The **\** component provides a container that allows users to switch among child components using swipe gestures.
## Required Permissions
diff --git a/en/application-dev/reference/arkui-js/js-components-container-tabs.md b/en/application-dev/reference/arkui-js/js-components-container-tabs.md
index 27b3e4d01a03743fd33a443f1ece9690c394c26d..02613285ab846edda7934c852bd1a5cb3400dcf7 100644
--- a/en/application-dev/reference/arkui-js/js-components-container-tabs.md
+++ b/en/application-dev/reference/arkui-js/js-components-container-tabs.md
@@ -13,8 +13,7 @@ None
## Child Components
-A **\** component can wrap at most one **[\](../arkui-js/js-components-container-tab-bar.md)** and at most one **[\](../arkui-js/js-components-container-tab-content.md)**.
-
+Only [\](../arkui-js/js-components-container-tab-bar.md) and [\](../arkui-js/js-components-container-tab-content.md) are supported.
## Attributes
@@ -23,7 +22,7 @@ In addition to the [universal attributes](../arkui-js/js-components-common-attri
| Name | Type | Default Value | Mandatory | Description |
| -------- | ------- | ----- | ---- | ---------------------------------------- |
| index | number | 0 | No | Index of the active tab. |
-| vertical | boolean | false | No | Whether the tab is vertical. Available values are as follows: - **false**: The **\** and **\** are arranged vertically. - **true**: The **\** and **\** are arranged horizontally.|
+| vertical | boolean | false | No | Whether the tab is vertical. Available values are as follows: - **false**: The **\** and **\** are arranged vertically. - **true**: The **\** and **\** are arranged horizontally. |
## Styles
diff --git a/en/application-dev/reference/arkui-js/js-components-create-elements.md b/en/application-dev/reference/arkui-js/js-components-create-elements.md
new file mode 100644
index 0000000000000000000000000000000000000000..b0afebfa68e40737f66361e501c67536472df8ac
--- /dev/null
+++ b/en/application-dev/reference/arkui-js/js-components-create-elements.md
@@ -0,0 +1,145 @@
+# Dynamic Component Creation
+
+You can dynamically add components with specified attributes and styles to pages.
+
+> **NOTE**
+>
+> This API is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
+
+
+## createElement
+
+createElement(tag: string): Element
+
+Creates a component object.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------- | ------------ | ---- | ------- |
+| tag | string | Yes | Component name.|
+
+**Return value**
+
+| Type | Description |
+| ----------- | ------------- |
+| Element | Component object corresponding to the value of **tag**.|
+
+```js
+let newImage = dom.createElement('image')
+```
+
+
+## setAttribute
+
+setAttribute(name: string, value: string): void
+
+Dynamically sets the attributes of this component.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------- | ------------ | ---- | ------- |
+| name | string | Yes | Attribute name.|
+| value | string | Yes | Attribute value.|
+
+```js
+newImage.setAttribute('src', 'common/testImage.jpg')
+```
+
+
+## setStyle
+
+setStyle(name: string, value: string): boolean
+
+Dynamically sets the style of this component.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------- | ------------ | ---- | ------- |
+| name | string | Yes | Style name.|
+| value | string | Yes | Style value.|
+
+**Return value**
+
+| Type | Description |
+| ----------- | ------------- |
+| boolean | Returns **true** if the setting is successful; returns **false** otherwise.|
+
+```js
+newImage.setStyle('width', '120px')
+```
+
+
+## addChild
+
+addChild(child: Element): void
+
+Adds a dynamically created component to the parent component.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------- | ------------ | ---- | ------- |
+| child | Element | Yes | Component object.|
+
+```js
+newDiv.addChild(newImage)
+```
+
+
+## Example
+
+```html
+
+
+
+ Dynamically create a
component.
+ Dynamically create an component and add it to the newly created
component.
+
+```
+
+```css
+/* xxx.css */
+.container {
+ flex-direction: column;
+ align-items: center;
+ width: 100%;
+}
+
+.parent {
+ flex-direction: column;
+}
+
+.btn {
+ width: 70%;
+ height: 60px;
+ margin: 15px;
+}
+```
+
+```js
+// xxx.js
+let newDiv = null
+let newImage = null
+
+export default {
+ appendDiv() {
+ let parent = this.$element('parentDiv')
+ newDiv = dom.createElement('div')
+ newDiv.setStyle('width', '150px')
+ newDiv.setStyle('height', '150px')
+ newDiv.setStyle('backgroundColor', '#AEEEEE')
+ newDiv.setStyle('marginTop', '15px')
+ parent.addChild(newDiv)
+ },
+ appendImage() {
+ newImage = dom.createElement('image')
+ newImage.setAttribute('src', 'common/testImage.jpg')
+ newImage.setStyle('width', '120px')
+ newImage.setStyle('height', '120px')
+ newDiv.addChild(newImage)
+ }
+}
+```
diff --git a/en/application-dev/reference/arkui-js/js-components-custom-basic-usage.md b/en/application-dev/reference/arkui-js/js-components-custom-basic-usage.md
index 8ae629cba3025d8d6b6d9f3ea4597678a6c1d138..b6f659f069b4e7c5f6dc6347664552a8c6a82e4d 100644
--- a/en/application-dev/reference/arkui-js/js-components-custom-basic-usage.md
+++ b/en/application-dev/reference/arkui-js/js-components-custom-basic-usage.md
@@ -1,6 +1,7 @@
-# Basic Usage
+# Basic Usage of Custom Components
+
+Custom components are existing components encapsulated based on service requirements. A custom component can be invoked multiple times in a project to improve the code readability. You can import a custom component to the host page through **element** as shown in the following code snippet:
-Custom components are existing components encapsulated based on service requirements. A custom component can be invoked multiple times in a project to improve the code readability. You can introduce a custom component to the host page through **element** as shown in the following code snippet:
```html
@@ -8,8 +9,8 @@ Custom components are existing components encapsulated based on service requirem
```
+The following is an example of using a custom component with **if-else**, which displays **comp1** when **showComp1** is set to **true** and displays **comp2** otherwise.
-The following is an example of using a custom component with **if-else**:
```html
@@ -19,18 +20,142 @@ The following is an example of using a custom component with **if-else**:
```
+The **name** attribute indicates the custom component name (optional), which is case-insensitive and is in lowercase by default. The **src** attribute indicates the **.hml** file path (mandatory) of the custom component. If **name** is not set, the **.hml** file name is used as the component name by default.
+
+
+## Custom Events
+
+To bind an event to a custom child component, use the **(on|@)event-name="bindParentVmMethod"** syntax. **this.$emit('eventName', { params: 'passedParameters' })** is used in the child component to trigger the event and pass parameters to the parent component. The parent component then calls the **bindParentVmMethod** API and receives parameters passed by the child component.
+
+> **NOTE**
+>
+> For child component events that are named in camel case, convert the names to kebab case when binding the events to the parent component. For example, use **\@children-event** in the parent component instead of **childrenEvent** used in the child component.
+
+**Example 1 with parameters passed**
+
+The following example describes how to define a child component **comp**:
+
+```html
+
+
+ Click here to view the hidden text.
+ hello world
+
+```
+
+```css
+/* xxx.css */
+.container {
+ background-color: #f8f8ff;
+ flex: 1;
+ flex-direction: column;
+ align-content: center;
+}
+```
+
+```js
+// xxx.js
+export default {
+ textClicked () {}
+}
+```
+
+**Example 2 with no parameters passed**
+
+The following example describes how to define a child component **comp**:
+
+```html
+
+
+ Click here to view the hidden text.
+ hello world
+
+```
+
+```js
+// comp.js
+export default {
+ childClicked () {
+ this.$emit('eventType1', { text: 'Receive the parameters from the child component.' });
+ this.showObj = !this.showObj;
+ },
+}
+```
+
+In the following example, the child component passes the **text** parameter to the parent component, and the parent component obtains the parameter through **e.detail**:
+
+```html
+
+
+
+ Parent component: {{text}}
+
+
+```
+
+```js
+// xxx.js
+export default {
+ data: {
+ text: 'Start'
+ },
+ textClicked (e) {
+ this.text = e.detail.text;
+ },
+}
+```
+
+
+
+
+## Custom Component Data
-- The **name** attribute indicates the custom component name (optional), which is case-insensitive and is in lowercase by default. The **src** attribute indicates the **.hml** file path (mandatory) of the custom component. If **name** is not set, the **.hml** file name is used as the component name by default.
-- Event binding: Use **(on|@)***child1* syntax to bind a child component event to a custom component. In the child component, use **this.$emit('***child1***', {params:'***parameter to pass***'})** for event triggering and value transferring. In the parent component, call **bindParentVmMethod** method and receive the parameters passed from the child component.
- > **NOTE**
- >
- > For child component events that are named in camel case, convert the names to kebab case when binding the events to the parent component. For example, use **\@children-event** instead of **childrenEvent**: **\@children-event="bindParentVmMethod"**.
+In the JS file of a custom component, you can define, pass, and process data by declaring fields such as **data**, **props**, and **computed**. For details about how to use **props** and **computed**, see [Data Transfer and Processing](js-components-custom-props.md).
-**Table 1** Objects
+**Table 1** Custom component data
-| Name | Type | Description |
+| Name | Type | Description |
| -------- | --------------- | ---------------------------------------- |
-| data | Object/Function | Data model of the page. If the attribute is of the function type, the return value must be of the object type. The attribute name cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (**for**, **if**, **show**, and **tid**). Do not use this attribute and **private** or **public** at the same time.(Rich) |
-| props | Array/Object | Used for communication between components. This attribute can be transferred to components via **\**. A **props** name must be in lowercase and cannot start with a dollar sign ($) or underscore (\_). Do not use reserved words (**for**, **if**, **show**, and **tid**). Currently, **props** does not support functions.|
-| computed | Object | Used for pre-processing an object for reading and setting. The result is cached. The name cannot start with a dollar sign ($) or underscore (\_). Do not use reserved words.|
+| data | Object \| Function | Data model of the page. If the attribute is of the function type, the return value must be of the object type. The name cannot start with a dollar sign ($) or underscore (\_). Do not use reserved words (**for**, **if**, **show**, and **tid**). Do not use this attribute and **private** or **public** at the same time.|
+| props | Array \| Object | Used for communication between components. This attribute can be passed to components through **\**. A **props** name must be in lowercase and cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (**for**, **if**, **show**, and **tid**) in the name. Currently, **props** does not support functions.|
+| computed | Object | Used for pre-processing for reading and setting parameters. The result is cached. The name cannot start with a dollar sign ($) or underscore (\_). Do not use reserved words.|
diff --git a/en/application-dev/reference/arkui-js/js-components-custom-event-parameter.md b/en/application-dev/reference/arkui-js/js-components-custom-event-parameter.md
deleted file mode 100644
index 55131eddc7e7613ae7fa58086ca5c59cc9ee35c9..0000000000000000000000000000000000000000
--- a/en/application-dev/reference/arkui-js/js-components-custom-event-parameter.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Event Parameter
-
-A child component can also pass parameters to an upper-layer component through the bound event. The following example describes how to pass parameters through the custom event:
-
-
-```html
-
-
- Click to View Hidden Text
- hello world
-
-```
-
-
-```js
-// comp.js
-export default {
- childClicked () {
- this.$emit('eventType1', {text: 'Received parameters from the child component.'});
- this.showObj = !this.showObj;
- },
-}
-```
-
-
-In the following example, the child component passes the **text** parameter to the parent component, and the parent component obtains the parameter through **e.detail**:
-
-
-```html
-
-
-
-```
-
-
-```css
-/* xxx.css */
-.container {
- background-color: #f8f8ff;
- flex: 1;
- flex-direction: column;
- align-content: center;
-}
-```
-
-
-```js
-// xxx.js
-export default {
- textClicked () {},
-}
-```
-
-For more information, see [Basic Usage](./js-components-custom-basic-usage.md).
diff --git a/en/application-dev/reference/arkui-js/js-components-custom-lifecycle.md b/en/application-dev/reference/arkui-js/js-components-custom-lifecycle.md
index efaf962b6d2be3e3cc36afda214a5cbcff31ec40..5445ca5247fc7ab43dac08c9099eeff1d484e3d0 100644
--- a/en/application-dev/reference/arkui-js/js-components-custom-lifecycle.md
+++ b/en/application-dev/reference/arkui-js/js-components-custom-lifecycle.md
@@ -5,7 +5,7 @@
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
-We provide a range of lifecycle callbacks for custom components, including **onInit**, **onAttached**, **onDetached**, **onLayoutReady**, **onDestroy**, **onShow**, and **onHide**. You can use these callbacks to manage the internal logic of your custom components. The following describes the times when the lifecycle callbacks are invoked.
+A range of lifecycle callbacks are provided for custom components, including **onInit**, **onAttached**, **onDetached**, **onLayoutReady**, **onDestroy**, **onShow**, and **onHide**. You can use these callbacks to manage the internal logic of your custom components. The following describes the times when the lifecycle callbacks are invoked.
| Attribute | Type | Description | Invoked When |
@@ -13,7 +13,7 @@ We provide a range of lifecycle callbacks for custom components, including **onI
| onInit | Function | Custom component initialization | The custom component is created. This callback is invoked once.|
| onAttached | Function | Custom component loading | The custom component is added to the **\** component tree. When this callback is invoked, related data can be displayed during the lifecycle in scenarios such as image loading and animation playback.|
| onLayoutReady | Function | Component layout completion| Layout calculation, including content size and position adjustment, is complete for the custom component.|
-| onDetached | Function | Custom component removal | The custom component is removed. It is usually used to stop animation or asynchronous logic execution.|
+| onDetached | Function | Custom component detachment | The custom component is detached. It is usually used to stop animation or asynchronous logic execution. |
| onDestroy | Function | Custom component destruction | The custom component is destroyed. It is usually used to release resources. |
| onShow | Function | Page display of a custom component| The page where the custom component is located is displayed. |
| onHide | Function | Page hiding of a custom component| The page where the custom component is located is hidden. |
@@ -24,7 +24,7 @@ We provide a range of lifecycle callbacks for custom components, including **onI
```html
- {{value}}
+ {{ value }}
```
@@ -39,9 +39,7 @@ export default {
},
onAttached() {
this.value = "Load the component."
- },
- onDetached() {
- this.value = ""
+ console.log ("Component loaded.")
},
onShow() {
console.log ("Page displayed.")
diff --git a/en/application-dev/reference/arkui-js/js-components-custom-props.md b/en/application-dev/reference/arkui-js/js-components-custom-props.md
index f2a3a4c4faf87d3230de6d128c9c55ad20548f9d..c9c496b57842c628eabb96377c8096c6a9cc1f9c 100644
--- a/en/application-dev/reference/arkui-js/js-components-custom-props.md
+++ b/en/application-dev/reference/arkui-js/js-components-custom-props.md
@@ -1,22 +1,25 @@
-# props
+# Data Transfer and Processing
-You can use **props** to declare attributes of a custom component and pass the attributes to the child component. The supported types of **props** include String, Number, Boolean, Array, Object, and Function. Note that a camel case attribute name \(**compProp**\) should be converted to the kebab case format \(**comp-prop**\) when you reference the attribute in an external parent component. You can add **props** to a custom component, and pass the attribute to the child component.
-```
+## props
+
+You can use **props** to declare attributes of a custom component and pass the attributes to the child component. The supported types of **props** include String, Number, Boolean, Array, Object, and Function. Note that a camel case attribute name (**compProp**) should be converted to the kebab case format (**comp-prop**) when you reference the attribute in an external parent component. The following is sample for adding **props** to a custom component and passing the attribute to the child component.
+
+```html
```
-> **NOTE:**
->The name of a custom attribute cannot start with reserved keywords such as **on**, **@**, **on:**, and **grab:**.
+> **NOTE**
+>
+> The name of a custom attribute cannot start with reserved keywords such as **on**, **@**, **on:**, and **grab:**.
-## Default Value
+### Default Value
-You can set the default value for a child component attribute via **default**. The default value is used if the parent component does not have **default** set. In this case, the **props** attribute must be in object format instead of an array.
+You can set the default value for a child component attribute via **default**. The default value is used if the parent component does not have **default** set. In this case, the **props** attribute must be in object format instead of an array.
-```
+```html
{{title}}
```
-```
+```js
// comp.js
export default {
props: {
@@ -49,21 +53,21 @@ export default {
}
```
-In this example, a **** component is added to display the title. The title content is a custom attribute, which displays the text specified by a user. If the user has not set a title, the default text will be displayed. Add the attribute when referencing the custom component.
+In this example, a **\** component is added to display the title. The title content is a custom attribute, which displays the text specified by a user. If the user has not set a title, the default text will be displayed. Add the attribute when referencing the custom component.
-```
+```html
-
+
```
-## Unidirectional Value Transfer
+### Unidirectional Value Transfer
-Data can be transferred only from the parent component to child components. You are not allowed to change the value passed to the child component. However, you can receive the value passed by **props** as a default value in **data**, and then change the **data** value.
+Data can be transferred only from the parent component to child components. You are not allowed to change the value passed to the child component. However, you can receive the value passed by **props** as a default value in **data**, and then change the **data** value.
-```
+```js
// comp.js
export default {
props: ['defaultCount'],
@@ -78,11 +82,11 @@ export default {
}
```
-## Monitoring Data Changes by **$watch**
+### Monitoring Data Changes by **$watch**
-To listen for attribute changes in a component, you can use the **$watch** method to add a callback. The following code snippet shows how to use **$watch**:
+To listen for attribute changes in a component, you can use the **$watch** method to add a callback. The following code snippet shows how to use **$watch**:
-```
+```js
// comp.js
export default {
props: ['title'],
@@ -90,16 +94,17 @@ export default {
this.$watch('title', 'onPropertyChange');
},
onPropertyChange(newV, oldV) {
- console.info('title attribute changed'+ newV + ' ' + oldV)
+ console.info('title attribute changed'+ newV + ' ' + oldV)
},
}
```
-## Computed Property
-To improve the development efficiency, you can use a computed property to pre-process an attribute in a custom component before reading or setting the attribute. In the **computed** field, you can set a getter or setter to be triggered when the attribute is read or written, respectively. The following is an example:
+## computed
-```
+To improve the development efficiency, you can use a computed property to pre-process an attribute in a custom component before reading or setting the attribute. In the **computed** field, you can set a getter or setter to be triggered when the attribute is read or written, respectively. The following is an example:
+
+```js
// comp.js
export default {
props: ['title'],
@@ -129,5 +134,4 @@ export default {
}
```
-The first computed property **message** has only a getter. The value of **message** changes depending on the **objTitle** value. The getter can only read but cannot set the value. You need a setter \(such as **notice** in the sample code\) to set the value of the computed property.
-
+The first computed property **message** has only a getter. The value of **message** changes depending on the **objTitle** value. The getter can only read but cannot set the value (such as **time** defined during initialization in **data**). You need a setter (such as **notice** in the sample code) to set the value of the computed property.
diff --git a/en/application-dev/reference/arkui-js/js-components-custom-slot.md b/en/application-dev/reference/arkui-js/js-components-custom-slot.md
index b65cfd01d2603195100ed8c0709289dd7b59b692..50c5b9ed0d1ad181567945134be95e0f9c229fed 100644
--- a/en/application-dev/reference/arkui-js/js-components-custom-slot.md
+++ b/en/application-dev/reference/arkui-js/js-components-custom-slot.md
@@ -1,13 +1,15 @@
-# slot
+# slot
-> **NOTE:**
->The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
+> **NOTE**
+>
+> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
-## Default Slot
-You can use the **** tag to create a slot inside a custom component to fill the content defined in the parent component. The sample code is as follows:
+## Default Slot
-```
+You can use the **\** tag to create a slot inside a custom component to fill the content defined in the parent component. The sample code is as follows:
+
+```html
The following uses the content defined in the parent component.
@@ -16,22 +18,22 @@ You can use the **** tag to create a slot inside a custom component to
```
The following references the custom component:
-
-```
+```html
- Content defined in the parent component
+ Content defined in the parent component
```
-## Named Slot
-When multiple slots are need inside a custom component, you can name them, so that you can specify the slot in which you want to fill content by setting the **** attribute.
+## Named Slot
-```
+When multiple slots are need inside a custom component, you can name them, so that you can specify the slot in which you want to fill content by setting the **** attribute.
+
+```html
The following uses the content defined in the parent component.
@@ -41,8 +43,7 @@ When multiple slots are need inside a custom component, you can name them, so th
```
The following references the custom component:
-
-```
+```html
@@ -53,6 +54,6 @@ The following references the custom component:
```
-> **NOTE:**
->**** and **** do not support dynamic data binding.
-
+> **NOTE**
+>
+> **\** and **\** do not support dynamic data binding.
diff --git a/en/application-dev/reference/arkui-js/js-components-custom-style.md b/en/application-dev/reference/arkui-js/js-components-custom-style.md
index 37e0770cdeec8de1e3bd3c89360c56973353cea4..ba8644e3e347e700b523ea0c7f2ab02159faeca7 100644
--- a/en/application-dev/reference/arkui-js/js-components-custom-style.md
+++ b/en/application-dev/reference/arkui-js/js-components-custom-style.md
@@ -1,16 +1,19 @@
# Style Inheritance
+
> **NOTE**
-> The APIs of this module are supported since API 9. Updates will be marked with a superscript to indicate their earliest API version.
+>
+> The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
A custom component has the **inherit-class** attribute, which is defined in the following table.
-| Name | Type | Default Value| Mandatory| Description |
-| ------------ | ------ | ------ | ---- | ------------------------------------------------------ |
-| inherit-class | string | - | No | Class styles inherited from the parent component, seperated by spaces.|
+| Name | Type | Default Value | Mandatory | Description |
+| ------------- | ------ | ---- | ---- | -------------------------------- |
+| inherit-class | string | - | No | Class styles inherited from the parent component, separated by spaces.|
To enable a custom component to inherit the styles of its parent component, set the **inherit-calss** attribute for the custom component.
-The example below is a code snippet in the HML file of the parent page that references a custom component named **comp**. This component uses the **inherit-class** attribute to inherit the styles of its parent component: **parent-class1** and **parent-class2**.
+The example below is a code snippet in the HML file of the parent component that references a custom component named **comp**. This component uses the **inherit-class** attribute to inherit the styles of its parent component: **parent-class1** and **parent-class2**.
+
```html
@@ -20,9 +23,10 @@ The example below is a code snippet in the HML file of the parent page that refe
```
-Code snippet in the CSS file of the parent page:
-```html
-// xxx.css
+Code snippet in the CSS file of the parent component:
+
+```css
+/* xxx.css */
.parent-class1 {
background-color:red;
border:2px;
@@ -34,6 +38,7 @@ Code snippet in the CSS file of the parent page:
```
Code snippet in the HML file of the custom component, where **parent-class1** and **parent-class2** are styles inherited from the parent component:
+
```html
diff --git a/en/application-dev/reference/arkui-js/js-components-media-video.md b/en/application-dev/reference/arkui-js/js-components-media-video.md
index c024cbe0058093b754c98f04f579b1cd7dac620f..0141e4818d35042cdef8f77362a95bb3d641b4d8 100644
--- a/en/application-dev/reference/arkui-js/js-components-media-video.md
+++ b/en/application-dev/reference/arkui-js/js-components-media-video.md
@@ -3,17 +3,7 @@
> **NOTE**
>
-> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
->
-> - Set **configChanges** under **abilities** in the **config.json** file to **orientation**.
-> ```
-> "abilities": [
-> {
-> "configChanges": ["orientation"],
-> ...
-> }
-> ]
-> ```
+> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
The **\