未验证 提交 abb2de79 编写于 作者: O openharmony_ci 提交者: Gitee

!11070 en\application-dev\reference\arkui-js 文件夹修改纯净MD格式

Merge pull request !11070 from ester.zhou/C-1027
# piece<a name="EN-US_TOPIC_0000001173164767"></a>
An entrance piece that can contain images and text. It is usually used to display receivers, for example, email recipients or message recipients.
## Child Component<a name="section9288143101012"></a>
None
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="14.5014501450145%" id="mcps1.1.6.1.1"><p id="a45273e2103004ff3bdd3375013e96a2a"><a name="a45273e2103004ff3bdd3375013e96a2a"></a><a name="a45273e2103004ff3bdd3375013e96a2a"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="12.62126212621262%" id="mcps1.1.6.1.2"><p id="ad5b10d4a60e44bb4a8bbb3b4416d7b27"><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a><a name="ad5b10d4a60e44bb4a8bbb3b4416d7b27"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.03080308030803%" id="mcps1.1.6.1.3"><p id="ab2ae3d9f60d6475ab95ba095851a9d07"><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a><a name="ab2ae3d9f60d6475ab95ba095851a9d07"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="6.64066406640664%" id="mcps1.1.6.1.4"><p id="p154141646194"><a name="p154141646194"></a><a name="p154141646194"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="58.2058205820582%" id="mcps1.1.6.1.5"><p id="af5c3b773ed0a42e589819a6c8d257ca1"><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a><a name="af5c3b773ed0a42e589819a6c8d257ca1"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1875918426407"><td class="cellrowborder" valign="top" width="14.5014501450145%" headers="mcps1.1.6.1.1 "><p id="p15759174219407"><a name="p15759174219407"></a><a name="p15759174219407"></a>content</p>
</td>
<td class="cellrowborder" valign="top" width="12.62126212621262%" headers="mcps1.1.6.1.2 "><p id="p14759184212400"><a name="p14759184212400"></a><a name="p14759184212400"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.03080308030803%" headers="mcps1.1.6.1.3 "><p id="p575913424403"><a name="p575913424403"></a><a name="p575913424403"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.64066406640664%" headers="mcps1.1.6.1.4 "><p id="p24156461792"><a name="p24156461792"></a><a name="p24156461792"></a>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="58.2058205820582%" headers="mcps1.1.6.1.5 "><p id="p1975944244011"><a name="p1975944244011"></a><a name="p1975944244011"></a>Text content of the operational piece.</p>
</td>
</tr>
<tr id="row1401171483915"><td class="cellrowborder" valign="top" width="14.5014501450145%" headers="mcps1.1.6.1.1 "><p id="p637566151211"><a name="p637566151211"></a><a name="p637566151211"></a>closable</p>
</td>
<td class="cellrowborder" valign="top" width="12.62126212621262%" headers="mcps1.1.6.1.2 "><p id="p134021148395"><a name="p134021148395"></a><a name="p134021148395"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="8.03080308030803%" headers="mcps1.1.6.1.3 "><p id="p1840211418393"><a name="p1840211418393"></a><a name="p1840211418393"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="6.64066406640664%" headers="mcps1.1.6.1.4 "><p id="p1415746595"><a name="p1415746595"></a><a name="p1415746595"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.2058205820582%" headers="mcps1.1.6.1.5 "><p id="p19402201416398"><a name="p19402201416398"></a><a name="p19402201416398"></a>Whether to display the delete icon for the operational piece. When users click the delete icon, it triggers the close event.</p>
</td>
</tr>
<tr id="row78648123418"><td class="cellrowborder" valign="top" width="14.5014501450145%" headers="mcps1.1.6.1.1 "><p id="p173023953412"><a name="p173023953412"></a><a name="p173023953412"></a>icon</p>
</td>
<td class="cellrowborder" valign="top" width="12.62126212621262%" headers="mcps1.1.6.1.2 "><p id="p530216953412"><a name="p530216953412"></a><a name="p530216953412"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="8.03080308030803%" headers="mcps1.1.6.1.3 "><p id="p3302149133418"><a name="p3302149133418"></a><a name="p3302149133418"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="6.64066406640664%" headers="mcps1.1.6.1.4 "><p id="p103024953410"><a name="p103024953410"></a><a name="p103024953410"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="58.2058205820582%" headers="mcps1.1.6.1.5 "><p id="p230211914342"><a name="p230211914342"></a><a name="p230211914342"></a>URL of the delete icon for the operational piece. The value can be a local path.</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section17756476592"></a>
Styles in [Universal Styles](js-components-common-styles.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>By default, text and images are placed in the middle of the **<piece\>** component.
## Events<a name="section19137152119"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table3674139193020"></a>
<table><thead align="left"><tr id="row14674539123012"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row418514431304"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p11911549133016"><a name="p11911549133016"></a><a name="p11911549133016"></a>close</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p1691204993018"><a name="p1691204993018"></a><a name="p1691204993018"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1891114933015"><a name="p1891114933015"></a><a name="p1891114933015"></a>Triggered when users click the delete icon of the operational piece. You can delete this component by using the <strong id="b1276472010487"><a name="b1276472010487"></a><a name="b1276472010487"></a>if</strong> directive.</p>
</td>
</tr>
</tbody>
</table>
## Method<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section118886119320"></a>
# piece
```
> **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
The **\<piece>** component provides an entrance piece that can contain images and text. It is usually used to display receivers, for example, email recipients or message recipients.
## Child Components
Not supported
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Mandatory| Description |
| -------- | ------- | ---- | ------------------------------------------------------------ |
| content | string | Yes | Text content of the operational piece. |
| closable | boolean | No | Whether to display the delete icon for the operational piece. When users click the delete icon, it triggers the close event.<br>Default value: **false**|
| icon | string | No | URL of the delete icon for the operational piece. The value can be a local path. |
## Styles
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
> **NOTE**
>
> By default, text and images are placed in the middle of the **\<piece>** component.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description |
| ----- | ---- | ----------------------------------- |
| close | - | Triggered when users click the delete icon of the operational piece. You can delete this component by using the **if** directive.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml-->
<div class="container" >
<piece if="{{first}}" content="example"></piece>
......@@ -103,7 +54,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div>
```
```
```css
/* xxx.css */
.container {
width: 100%;
......@@ -113,7 +64,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
}
```
```
```js
// xxx.js
export default {
data: {
......@@ -126,5 +77,4 @@ export default {
}
```
![](figures/11-5.gif)
![11-5](figures/11-5.gif)
# rating<a name="EN-US_TOPIC_0000001173324645"></a>
# rating
The **<rating\>** component provides a rating bar used for reviews and ratings.
> **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a>
The **\<rating>** component provides a rating bar used for reviews and ratings.
## Required Permissions
None
## Child Components<a name="section9288143101012"></a>
## Child Components
Not supported
## Attributes<a name="section2907183951110"></a>
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aa872998ac2d84843a3c5161889afffef"><a name="aa872998ac2d84843a3c5161889afffef"></a><a name="aa872998ac2d84843a3c5161889afffef"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p id="ab2111648ee0e4f6d881be8954e7acaab"><a name="ab2111648ee0e4f6d881be8954e7acaab"></a><a name="ab2111648ee0e4f6d881be8954e7acaab"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p id="ab377d1c90900478ea4ecab51e9a058af"><a name="ab377d1c90900478ea4ecab51e9a058af"></a><a name="ab377d1c90900478ea4ecab51e9a058af"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p id="p824610360217"><a name="p824610360217"></a><a name="p824610360217"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p id="a1d574a0044ed42ec8a2603bc82734232"><a name="a1d574a0044ed42ec8a2603bc82734232"></a><a name="a1d574a0044ed42ec8a2603bc82734232"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row5141051050"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p157381413961"><a name="p157381413961"></a><a name="p157381413961"></a>numstars</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p973881313619"><a name="p973881313619"></a><a name="p973881313619"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1973871314616"><a name="p1973871314616"></a><a name="p1973871314616"></a>5</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p473891317617"><a name="p473891317617"></a><a name="p473891317617"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p173811138611"><a name="p173811138611"></a><a name="p173811138611"></a>Maximum number of rating stars.</p>
</td>
</tr>
<tr id="row11475954"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p1973821316618"><a name="p1973821316618"></a><a name="p1973821316618"></a>rating</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p19738131320620"><a name="p19738131320620"></a><a name="p19738131320620"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p07386135610"><a name="p07386135610"></a><a name="p07386135610"></a>0</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1673831319613"><a name="p1673831319613"></a><a name="p1673831319613"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p107382131366"><a name="p107382131366"></a><a name="p107382131366"></a>Current rating stars.</p>
</td>
</tr>
<tr id="row1372245811411"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p5738101319611"><a name="p5738101319611"></a><a name="p5738101319611"></a>stepsize</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p77381713261"><a name="p77381713261"></a><a name="p77381713261"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1073831312620"><a name="p1073831312620"></a><a name="p1073831312620"></a>0.5</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p5738613465"><a name="p5738613465"></a><a name="p5738613465"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p27381813364"><a name="p27381813364"></a><a name="p27381813364"></a>Step to increment the rating value.</p>
<div class="note" id="note1249472985312"><a name="note1249472985312"></a><a name="note1249472985312"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p749462910531"><a name="p749462910531"></a><a name="p749462910531"></a></p>
</div></div>
</td>
</tr>
<tr id="row192599563412"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p16738813966"><a name="p16738813966"></a><a name="p16738813966"></a>indicator</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p id="p47381313769"><a name="p47381313769"></a><a name="p47381313769"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p id="p1273815131861"><a name="p1273815131861"></a><a name="p1273815131861"></a>false</p>
</td>
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1073912131165"><a name="p1073912131165"></a><a name="p1073912131165"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p87391131166"><a name="p87391131166"></a><a name="p87391131166"></a>Whether to make the rating icons as an indicator (not-editable by users).</p>
</td>
</tr>
</tbody>
</table>
## Styles<a name="section5775351116"></a>
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported.
<a name="table179091550174914"></a>
<table><thead align="left"><tr id="row1190955064913"><th class="cellrowborder" valign="top" width="20.71792820717928%" id="mcps1.1.6.1.1"><p id="p119091450154913"><a name="p119091450154913"></a><a name="p119091450154913"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="20.80791920807919%" id="mcps1.1.6.1.2"><p id="p390945020497"><a name="p390945020497"></a><a name="p390945020497"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="10.93890610938906%" id="mcps1.1.6.1.3"><p id="p2090917504493"><a name="p2090917504493"></a><a name="p2090917504493"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p id="p189091750114910"><a name="p189091750114910"></a><a name="p189091750114910"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p id="p79091750124917"><a name="p79091750124917"></a><a name="p79091750124917"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row17909450124912"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p790935084914"><a name="p790935084914"></a><a name="p790935084914"></a>star-background</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p129091350164920"><a name="p129091350164920"></a><a name="p129091350164920"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p99099503496"><a name="p99099503496"></a><a name="p99099503496"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1909125019497"><a name="p1909125019497"></a><a name="p1909125019497"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p79091050184910"><a name="p79091050184910"></a><a name="p79091050184910"></a>Background image when a rating star is unselected. Only PNG and JPG images in a local path are supported.</p>
</td>
</tr>
<tr id="row139092504495"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p19909185044919"><a name="p19909185044919"></a><a name="p19909185044919"></a>star-foreground</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p18909145064913"><a name="p18909145064913"></a><a name="p18909145064913"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p11909550204915"><a name="p11909550204915"></a><a name="p11909550204915"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p99101508497"><a name="p99101508497"></a><a name="p99101508497"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1091015502499"><a name="p1091015502499"></a><a name="p1091015502499"></a>Foreground image when a rating star is selected. Only PNG and JPG images in a local path are supported.</p>
</td>
</tr>
<tr id="row15910185012492"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p2910145018491"><a name="p2910145018491"></a><a name="p2910145018491"></a>star-secondary</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p16910145024916"><a name="p16910145024916"></a><a name="p16910145024916"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p7910125064915"><a name="p7910125064915"></a><a name="p7910125064915"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p8910150204910"><a name="p8910150204910"></a><a name="p8910150204910"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p391095015494"><a name="p391095015494"></a><a name="p391095015494"></a>Secondary background image when a rating star is partially selected. This image will cover the background image and can only be a PNG or JPG image from a local path.</p>
</td>
</tr>
<tr id="row12910155014493"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p7910135054915"><a name="p7910135054915"></a><a name="p7910135054915"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p69101950104910"><a name="p69101950104910"></a><a name="p69101950104910"></a>&lt;length&gt;|&lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p391015084913"><a name="p391015084913"></a><a name="p391015084913"></a>120 px</p>
<p id="p1391055012499"><a name="p1391055012499"></a><a name="p1391055012499"></a>60 px (cannot be edited)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p13910125064911"><a name="p13910125064911"></a><a name="p13910125064911"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1591035014911"><a name="p1591035014911"></a><a name="p1591035014911"></a>Image width. The default value is the width of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.</p>
</td>
</tr>
<tr id="row79101550124915"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p1591005054915"><a name="p1591005054915"></a><a name="p1591005054915"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p2091095024920"><a name="p2091095024920"></a><a name="p2091095024920"></a>&lt;length&gt;|&lt;percentage&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p20910155014915"><a name="p20910155014915"></a><a name="p20910155014915"></a>24px</p>
<p id="p29101650104920"><a name="p29101650104920"></a><a name="p29101650104920"></a>12 px (cannot be edited)</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p491055024914"><a name="p491055024914"></a><a name="p491055024914"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1491065074910"><a name="p1491065074910"></a><a name="p1491065074910"></a>Image height. The default value is the height of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.</p>
</td>
</tr>
<tr id="row791012500491"><td class="cellrowborder" valign="top" width="20.71792820717928%" headers="mcps1.1.6.1.1 "><p id="p29108504492"><a name="p29108504492"></a><a name="p29108504492"></a>rtl-flip</p>
</td>
<td class="cellrowborder" valign="top" width="20.80791920807919%" headers="mcps1.1.6.1.2 "><p id="p109107509490"><a name="p109107509490"></a><a name="p109107509490"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="10.93890610938906%" headers="mcps1.1.6.1.3 "><p id="p391065018494"><a name="p391065018494"></a><a name="p391065018494"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p id="p1891015034920"><a name="p1891015034920"></a><a name="p1891015034920"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p391011508492"><a name="p391011508492"></a><a name="p391011508492"></a>Whether the image source is automatically flipped in the RTL text direction.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>You must set **star-background**, **star-secondary**, and **star-foreground**. Otherwise, the rating star is gray, indicating that the image is set incorrectly.
## Events<a name="section124498406719"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table836435619510"></a>
<table><thead align="left"><tr id="row153658563517"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="a426b8903842d48fa8012a24ff3c997eb"><a name="a426b8903842d48fa8012a24ff3c997eb"></a><a name="a426b8903842d48fa8012a24ff3c997eb"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="a53448ba47e5e4ae9bf7774c90820e970"><a name="a53448ba47e5e4ae9bf7774c90820e970"></a><a name="a53448ba47e5e4ae9bf7774c90820e970"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="add489ff50c444f24b759162c7f4bad9a"><a name="add489ff50c444f24b759162c7f4bad9a"></a><a name="add489ff50c444f24b759162c7f4bad9a"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row518915212082"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p125587286811"><a name="p125587286811"></a><a name="p125587286811"></a>change</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p255820281687"><a name="p255820281687"></a><a name="p255820281687"></a>{ rating: number }</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p10558228886"><a name="p10558228886"></a><a name="p10558228886"></a>Triggered when the rating value changes.</p>
</td>
</tr>
</tbody>
</table>
## Methods<a name="section2279124532420"></a>
Methods in [Universal Methods](js-components-common-methods.md) are supported.
## Example<a name="section1715414253487"></a>
```
## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| numstars | number | 5 | No| Maximum number of rating stars.|
| rating | number | 0 | No| Number of stars rated.|
| stepsize | number | 0.5 | No| Step to increase the rating value.|
| indicator | boolean | false | No| Whether to make the rating icons as an indicator (not-editable by users).|
## 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|
| -------- | -------- | -------- | -------- | -------- |
| star-background | string | - | No| Background image when a rating star is unselected. Only PNG and JPG images in a local path are supported.|
| star-foreground | string | - | No| Foreground image when a rating star is selected. Only PNG and JPG images in a local path are supported.|
| star-secondary | string | - | No| Secondary background image when a rating star is partially selected. This image will cover the background image and can only be a PNG or JPG image from a local path.|
| width | &lt;length&gt;\|&lt;percentage&gt; | 120px<br>60 px (cannot be edited)| No| Image width. The default value is the width of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.|
| height | &lt;length&gt;\|&lt;percentage&gt; | 24px<br>12px (cannot be edited)| No| Image height. The default value is the height of the default image for five-star ratings. If you do not set the maximum rating value and background images of the rating stars, the default value will be used.|
| rtl-flip | boolean | true | No| Whether the image source is automatically flipped in the RTL text direction.|
> **NOTE**
>
> You must set **star-background**, **star-secondary**, and **star-foreground**. Otherwise, the rating star is gray, indicating that the image is set incorrectly.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| change | { rating: number } | Triggered when the rating value changes.|
## Methods
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
## Example
```html
<!-- xxx.hml -->
<div class="container">
<rating numstars="5" rating="5" @change="changeRating" id="rating">
......@@ -204,7 +71,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div>
```
```
```css
/* xxx.css */
.container {
display: flex;
......@@ -216,7 +83,7 @@ rating {
}
```
```
```js
// xxx.js
import prompt from '@system.prompt';
export default {
......@@ -228,5 +95,4 @@ export default {
}
```
![](figures/1-6.png)
![1-6](figures/1-6.png)
# richtext<a name="EN-US_TOPIC_0000001173164701"></a>
# richtext
The **<richtext\>** component displays rich text information.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>- The rich text content must be written in the content area.
> **NOTE**
>
> - This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The rich text content must be written in the content area.
## Required Permissions<a name="section11257113618419"></a>
The **\<richtext>** component displays rich text information.
## Required Permissions
None
## Attributes<a name="section2907183951110"></a>
Only the **id**, **style**, and **class** attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
## Styles<a name="section5775351116"></a>
Only the **display** and** visibility** styles in [Universal Styles](js-components-common-styles.md) are supported.
## Events<a name="section17878123517511"></a>
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
<a name="table13878203565113"></a>
<table><thead align="left"><tr id="row18789355519"><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p id="p08781335165113"><a name="p08781335165113"></a><a name="p08781335165113"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p id="p6878123595117"><a name="p6878123595117"></a><a name="p6878123595117"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p id="p28783359518"><a name="p28783359518"></a><a name="p28783359518"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row2087803565116"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p3878113518516"><a name="p3878113518516"></a><a name="p3878113518516"></a>start</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p187813511516"><a name="p187813511516"></a><a name="p187813511516"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p1269067752"><a name="p1269067752"></a><a name="p1269067752"></a>Triggered when the loading starts.</p>
</td>
</tr>
<tr id="row28781235145111"><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p id="p118810157518"><a name="p118810157518"></a><a name="p118810157518"></a>complete</p>
</td>
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p id="p19878535135111"><a name="p19878535135111"></a><a name="p19878535135111"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p id="p13878335145119"><a name="p13878335145119"></a><a name="p13878335145119"></a>Triggered when the loading is complete.</p>
</td>
</tr>
</tbody>
</table>
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>- The **focus**, **blur**, and **key** events are not supported.
>- Accessibility events are not supported.
>- When a page containing **<richtext\>** is returned, the page's transition effect does not apply to the area where the rich text is displayed.
>- Make sure the rich text does not go beyond the height of the screen. Otherwise, the excess content will not be displayed.
>- The width cannot be set. By default, the rich text is displayed in full screen.
## Methods<a name="section14703165113610"></a>
## Attributes
Only the **id**, **style**, and **class** attributes in [Universal Attributes](../arkui-js/js-components-common-attributes.md) are supported.
## Styles
Only the **display** and **visibility** styles in [Universal Styles](../arkui-js/js-components-common-styles.md) are supported.
## Events
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name| Parameter| Description|
| -------- | -------- | -------- |
| start | - | Triggered when loading starts.|
| complete | - | Triggered when the loading starts.|
> **NOTE**
> - The **focus**, **blur**, and **key** events are not supported.
>
> - Accessibility events are not supported.
>
> - When a page containing **\<richtext>** is returned, the page's transition effect does not apply to the area where the rich text is displayed.
>
> - Make sure the rich text does not go beyond the height of the screen. Otherwise, the excess content will not be displayed.
>
> - The width cannot be set. By default, the rich text is displayed in full screen.
## Methods
Not supported
## Example Code<a name="section581819591666"></a>
```
## Example
```html
<!-- xxx.hml -->
<div style="flex-direction: column;width: 100%;">
<richtext @start="onLoadStart" @complete="onLoadEnd">{{content}}</richtext>
</div>
```
```
```js
// xxx.js
export default {
data: {
......@@ -75,9 +67,9 @@ export default {
<div class="flex-direction: column; background-color: #ffffff; padding: 30px; margin-bottom: 30px;" style="background-color: #FFFFFF">
<style>h1{color: yellow;}</style>
<p class="item-title">h1</p>
<h1>Text test (H1 test)</h1>
<h1>Text test (h1 test)</h1>
<p class="item-title">h2</p>
<h2>Text test (H2 test)</h2>
<h2>Text test (h2 test)</h2>
</div>
`,
},
......@@ -89,4 +81,3 @@ export default {
}
}
```
# toolbar<a name="EN-US_TOPIC_0000001173324631"></a>
# toolbar
The **<toolbar\>** component provides a bar that is usually placed at the bottom of a page to display operation options for the page.
> **NOTE**
>
> This component is supported since API version 5. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a>
The **\<toolbar>** component provides a bar that is usually placed at the bottom of a page to display operation options for the page.
## Required Permissions
None
## Child Component<a name="section172027510456"></a>
Only the **<toolbar-item\>** component is supported.
## Child Components
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>A maximum of five **<toolbar-item\>** components can be contained in a **<toolbar\>** component. If there are six or more, only the first four are displayed, and the rest items are hidden in the **More** list of the toolbar. Users can click **More** to view the hidden items.
>The list is displayed in the default style instead of a customized style set for the **<toolbar-item\>** component.
Only the **\<toolbar-item>** component is supported.
## Attributes<a name="section153601034618"></a>
> **NOTE**
>
> A maximum of five **\<toolbar-item>** child components can be displayed in a **\<toolbar>** component. If there are six or more toolbar items, the first four are displayed, and the rest items are added to the **More** list of the toolbar. Users can click **More** to view the items. The list is displayed in the default style instead of the custom style set for the <toolbar-item> components.
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
## Styles<a name="section1889052254711"></a>
## Attributes
Styles in [Universal Styles](js-components-common-styles.md) are supported.
The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The **height** style is not supported. The height is fixed at 56px.
## Events<a name="section104349151916"></a>
## Styles
None
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
## Method<a name="section568225514199"></a>
> **NOTE**
>
> The **height** style is not supported. The height is fixed at 56px.
None
## Example Code<a name="section1597982719103"></a>
## Events
Not supported
## Methods
Not supported
For details, see the [toolbar-item example code](js-components-basic-toolbar-item.md).
## Example
For details, see [Example in toolbar-item](../arkui-js/js-components-basic-toolbar-item.md).
# xcomponent
> **NOTE**<br>
> **NOTE**
>
> This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
The **\<xcomponent>** displays the components to which the EGL/OpenGLES or media data is written.
......
# ImageBitmap<a name="EN-US_TOPIC_0000001181948861"></a>
# ImageBitmap
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>**ImageBitmap** is 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.
The **ImageBitmap** object is generated by the **transferToImageBitmap\(\)** method of the **OffscreenCanvas** and stores the pixel data rendered on the **OffscreenCanvas**.
## Attributes<a name="section661391987"></a>
The **ImageBitmap** object is an object generated using the **transferToImageBitmap()** method of the **OffscreenCanvas** and stores the pixel data rendered on the **OffscreenCanvas**.
<a name="table67211828124016"></a>
<table><thead align="left"><tr id="row108577289405"><th class="cellrowborder" valign="top" width="22.872287228722872%" id="mcps1.1.4.1.1"><p id="p385742814403"><a name="p385742814403"></a><a name="p385742814403"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="29.352935293529352%" id="mcps1.1.4.1.2"><p id="p19857192816408"><a name="p19857192816408"></a><a name="p19857192816408"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="47.774777477747776%" id="mcps1.1.4.1.3"><p id="p18573288402"><a name="p18573288402"></a><a name="p18573288402"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1085792824019"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p1485792815404"><a name="p1485792815404"></a><a name="p1485792815404"></a>width</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p11857182804010"><a name="p11857182804010"></a><a name="p11857182804010"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p1785711281405"><a name="p1785711281405"></a><a name="p1785711281405"></a>Pixel width of the <strong id="b1722548101315"><a name="b1722548101315"></a><a name="b1722548101315"></a>ImageBitmap</strong> object.</p>
</td>
</tr>
<tr id="row3857132812406"><td class="cellrowborder" valign="top" width="22.872287228722872%" headers="mcps1.1.4.1.1 "><p id="p88572283404"><a name="p88572283404"></a><a name="p88572283404"></a>height</p>
</td>
<td class="cellrowborder" valign="top" width="29.352935293529352%" headers="mcps1.1.4.1.2 "><p id="p198571828114017"><a name="p198571828114017"></a><a name="p198571828114017"></a>number</p>
</td>
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.1.4.1.3 "><p id="p3857192844012"><a name="p3857192844012"></a><a name="p3857192844012"></a>Pixel height of the <strong id="b199991910181313"><a name="b199991910181313"></a><a name="b199991910181313"></a>ImageBitmap</strong> object.</p>
</td>
</tr>
</tbody>
</table>
## Attributes
| Name| Type| Description|
| -------- | -------- | -------- |
| width | number | Pixel width of the **ImageBitmap** object.|
| height | number | Pixel height of the **ImageBitmap** object.|
# Universal Attributes
> **NOTE**<br>
> **NOTE**
>
> Universal attributes are supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
## Common Attributes
......
# div
The **\<div>** component is a basic container that is used as the root node of the page structure or is used to group the content.
> **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
The **\<div>** component is a basic container that is used as the root node of the page structure or is used to group the content.
## Required Permissions
......
......@@ -18,7 +18,7 @@ None
## Child Components
Only the [\<list-item>](../arkui-js/js-components-container-list-item.md) child component is supported.
Only the **[\<list-item>](../arkui-js/js-components-container-list-item.md)** component is supported.
## Attributes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册