提交 93f43ba3 编写于 作者: E ester.zhou

Update docs (1027)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 b53939eb
# piece<a name="EN-US_TOPIC_0000001173164767"></a> # piece
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>
``` > **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--> <!-- xxx.hml-->
<div class="container" > <div class="container" >
<piece if="{{first}}" content="example"></piece> <piece if="{{first}}" content="example"></piece>
...@@ -103,7 +54,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -103,7 +54,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
width: 100%; width: 100%;
...@@ -113,7 +64,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -113,7 +64,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
} }
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -126,5 +77,4 @@ export default { ...@@ -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 None
## Child Components<a name="section9288143101012"></a>
## Child Components
Not supported 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 --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<rating numstars="5" rating="5" @change="changeRating" id="rating"> <rating numstars="5" rating="5" @change="changeRating" id="rating">
...@@ -204,7 +71,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported. ...@@ -204,7 +71,7 @@ Methods in [Universal Methods](js-components-common-methods.md) are supported.
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -216,7 +83,7 @@ rating { ...@@ -216,7 +83,7 @@ rating {
} }
``` ```
``` ```js
// xxx.js // xxx.js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
export default { export default {
...@@ -228,5 +95,4 @@ 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:** > **NOTE**
>- The rich text content must be written in the content area. >
> - 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 None
## Attributes<a name="section2907183951110"></a>
## Attributes
Only the **id**, **style**, and **class** attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
Only the **id**, **style**, and **class** attributes in [Universal Attributes](../arkui-js/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. ## Styles
## Events<a name="section17878123517511"></a> Only the **display** and **visibility** styles in [Universal Styles](../arkui-js/js-components-common-styles.md) are supported.
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.
## Events
<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> In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
</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> | Name| Parameter| Description|
</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> | start | - | Triggered when loading starts.|
</th> | complete | - | Triggered when the loading starts.|
</tr>
</thead> > **NOTE**
<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> > - The **focus**, **blur**, and **key** events are not supported.
</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> > - Accessibility events are not supported.
</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> > - When a page containing **\<richtext>** is returned, the page's transition effect does not apply to the area where the rich text is displayed.
</td> >
</tr> > - Make sure the rich text does not go beyond the height of the screen. Otherwise, the excess content will not be displayed.
<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> > - The width cannot be set. By default, the rich text is displayed in full screen.
<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> ## Methods
</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>
Not supported Not supported
## Example Code<a name="section581819591666"></a>
``` ## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div style="flex-direction: column;width: 100%;"> <div style="flex-direction: column;width: 100%;">
<richtext @start="onLoadStart" @complete="onLoadEnd">{{content}}</richtext> <richtext @start="onLoadStart" @complete="onLoadEnd">{{content}}</richtext>
</div> </div>
``` ```
``` ```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -75,9 +67,9 @@ export default { ...@@ -75,9 +67,9 @@ export default {
<div class="flex-direction: column; background-color: #ffffff; padding: 30px; margin-bottom: 30px;" style="background-color: #FFFFFF"> <div class="flex-direction: column; background-color: #ffffff; padding: 30px; margin-bottom: 30px;" style="background-color: #FFFFFF">
<style>h1{color: yellow;}</style> <style>h1{color: yellow;}</style>
<p class="item-title">h1</p> <p class="item-title">h1</p>
<h1>Text test (H1 test)</h1> <h1>Text test (h1 test)</h1>
<p class="item-title">h2</p> <p class="item-title">h2</p>
<h2>Text test (H2 test)</h2> <h2>Text test (h2 test)</h2>
</div> </div>
`, `,
}, },
...@@ -89,4 +81,3 @@ export default { ...@@ -89,4 +81,3 @@ export default {
} }
} }
``` ```
# span<a name="EN-US_TOPIC_0000001127284860"></a> # span
The **<span\>** child component of **<[text](js-components-basic-text.md)\>** is used as a text modifier. > **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> As a child component of **[\<text>](../arkui-js/js-components-basic-text.md)**, the **\<span>** component is used as a text modifier.
## Required Permissions
None None
## Child Components<a name="section9288143101012"></a>
## Child Component
The **<span\>** child component is supported.
## Attributes<a name="section2907183951110"></a>
Attributes in [Universal Attributes](js-components-common-attributes.md) are supported.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The **focusable** and **disabled** attributes are not supported.
## Styles<a name="section5775351116"></a>
Only the following style attributes are supported.
<a name="ta0a517e341374f8dbac91fcbabd0a5ff"></a>
<table><thead align="left"><tr id="r4898f887897a46fab1b4999a4f83402f"><th class="cellrowborder" valign="top" width="21.21212121212121%" id="mcps1.1.6.1.1"><p id="ac9b6b02cd94942a5a0de6e18b10be274"><a name="ac9b6b02cd94942a5a0de6e18b10be274"></a><a name="ac9b6b02cd94942a5a0de6e18b10be274"></a>Name</p>
</th>
<th class="cellrowborder" valign="top" width="15.8015801580158%" id="mcps1.1.6.1.2"><p id="acdcd659d46f24eac86378824c8ee463b"><a name="acdcd659d46f24eac86378824c8ee463b"></a><a name="acdcd659d46f24eac86378824c8ee463b"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="14.231423142314231%" id="mcps1.1.6.1.3"><p id="a9def453e9df6412bba79b8fff70869e8"><a name="a9def453e9df6412bba79b8fff70869e8"></a><a name="a9def453e9df6412bba79b8fff70869e8"></a>Default Value</p>
</th>
<th class="cellrowborder" valign="top" width="9.400940094009401%" id="mcps1.1.6.1.4"><p id="a1e15f96e33ee48b9a0e14dbee0968f8a"><a name="a1e15f96e33ee48b9a0e14dbee0968f8a"></a><a name="a1e15f96e33ee48b9a0e14dbee0968f8a"></a>Mandatory</p>
</th>
<th class="cellrowborder" valign="top" width="39.35393539353936%" id="mcps1.1.6.1.5"><p id="a7168bff3ff0647d88967647f6ab26d5f"><a name="a7168bff3ff0647d88967647f6ab26d5f"></a><a name="a7168bff3ff0647d88967647f6ab26d5f"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r32272055007144f79a2dfea8a786e589"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="afc75d8f275cc41089a4e4dc8a3fbee88"><a name="afc75d8f275cc41089a4e4dc8a3fbee88"></a><a name="afc75d8f275cc41089a4e4dc8a3fbee88"></a>color</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="abf3cdb4352d94dbb96789b9920bff09e"><a name="abf3cdb4352d94dbb96789b9920bff09e"></a><a name="abf3cdb4352d94dbb96789b9920bff09e"></a>&lt;color&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a40a852f6f3624109acdb18b89f75be07"><a name="a40a852f6f3624109acdb18b89f75be07"></a><a name="a40a852f6f3624109acdb18b89f75be07"></a>-</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a61aed770cf534f06a236a689df6206e0"><a name="a61aed770cf534f06a236a689df6206e0"></a><a name="a61aed770cf534f06a236a689df6206e0"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a745abab21c7c47afbb4343f611f13f0e"><a name="a745abab21c7c47afbb4343f611f13f0e"></a><a name="a745abab21c7c47afbb4343f611f13f0e"></a>Font color of the modified text.</p>
</td>
</tr>
<tr id="r9962b94a230e482a9cc74bbb784ea7a0"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="a50ed6c7dc89a419b8196eb32f4374eb9"><a name="a50ed6c7dc89a419b8196eb32f4374eb9"></a><a name="a50ed6c7dc89a419b8196eb32f4374eb9"></a>font-size</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="a3fef950f99bb45768f232285d9563d59"><a name="a3fef950f99bb45768f232285d9563d59"></a><a name="a3fef950f99bb45768f232285d9563d59"></a>&lt;length&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="abf03dbbc119a4a158b410a3676fe71e6"><a name="abf03dbbc119a4a158b410a3676fe71e6"></a><a name="abf03dbbc119a4a158b410a3676fe71e6"></a>30px</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a221074f45b48460a953a19ae07181768"><a name="a221074f45b48460a953a19ae07181768"></a><a name="a221074f45b48460a953a19ae07181768"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a86d755d025194433a3d824ac6308dc19"><a name="a86d755d025194433a3d824ac6308dc19"></a><a name="a86d755d025194433a3d824ac6308dc19"></a>Font size of the modified text.</p>
</td>
</tr>
<tr id="row696318282019"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="p523512225579"><a name="p523512225579"></a><a name="p523512225579"></a>allow-scale</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="p923522212570"><a name="p923522212570"></a><a name="p923522212570"></a>boolean</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="p11235322145714"><a name="p11235322145714"></a><a name="p11235322145714"></a>true</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="p12235112285712"><a name="p12235112285712"></a><a name="p12235112285712"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="p1023513229570"><a name="p1023513229570"></a><a name="p1023513229570"></a>Whether the font size of the modified text changes with the system's font size settings.</p>
<div class="note" id="note5531128463"><a name="note5531128463"></a><a name="note5531128463"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p11531172814611"><a name="p11531172814611"></a><a name="p11531172814611"></a>If the <strong id="b9631151853613"><a name="b9631151853613"></a><a name="b9631151853613"></a>config-changes</strong> tag of <strong id="b15641171817360"><a name="b15641171817360"></a><a name="b15641171817360"></a>fontSize</strong> is configured for abilities in the <strong id="b20644418103618"><a name="b20644418103618"></a><a name="b20644418103618"></a>config.json</strong> file, the setting takes effect without application restart.</p>
</div></div>
</td>
</tr>
<tr id="rde507e70d93643ae8a6cb2d27c6acf99"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="ab1137579b73e4a38a6dbe7fe5d83e8e2"><a name="ab1137579b73e4a38a6dbe7fe5d83e8e2"></a><a name="ab1137579b73e4a38a6dbe7fe5d83e8e2"></a>font-style</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="ab7f6c9ddf05c44bda226d9bf186583eb"><a name="ab7f6c9ddf05c44bda226d9bf186583eb"></a><a name="ab7f6c9ddf05c44bda226d9bf186583eb"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a763035129469427a9b607b50c93c046d"><a name="a763035129469427a9b607b50c93c046d"></a><a name="a763035129469427a9b607b50c93c046d"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="abdb1cd99a9c84f31b1bb21da686ded28"><a name="abdb1cd99a9c84f31b1bb21da686ded28"></a><a name="abdb1cd99a9c84f31b1bb21da686ded28"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a04816275b7d249079b4a1e80f69ea86e"><a name="a04816275b7d249079b4a1e80f69ea86e"></a><a name="a04816275b7d249079b4a1e80f69ea86e"></a>Font style of the modified text. For details, see <a href="js-components-basic-text.md#section5775351116">font-style</a> of the <strong id="b18795152647"><a name="b18795152647"></a><a name="b18795152647"></a>text</strong> component.</p>
</td>
</tr>
<tr id="r41ee5629370e4317a0da49957e128ade"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="a380a51eccb244ea9a528c41348105934"><a name="a380a51eccb244ea9a528c41348105934"></a><a name="a380a51eccb244ea9a528c41348105934"></a>font-weight</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="a6998d5f15b9d47dfb5ea5d683f2945ef"><a name="a6998d5f15b9d47dfb5ea5d683f2945ef"></a><a name="a6998d5f15b9d47dfb5ea5d683f2945ef"></a>number | string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a9cd90194128142d6bf6a0279aa8d191e"><a name="a9cd90194128142d6bf6a0279aa8d191e"></a><a name="a9cd90194128142d6bf6a0279aa8d191e"></a>normal</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a16edddde0d944b13a7a3567677cc913d"><a name="a16edddde0d944b13a7a3567677cc913d"></a><a name="a16edddde0d944b13a7a3567677cc913d"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="aa1d0d3abf811468e8c3f707e1a7e5b8c"><a name="aa1d0d3abf811468e8c3f707e1a7e5b8c"></a><a name="aa1d0d3abf811468e8c3f707e1a7e5b8c"></a>Font weight of the modified text. For details, see <a href="js-components-basic-text.md#section5775351116">font-weight</a> of the <strong id="b1695595210517"><a name="b1695595210517"></a><a name="b1695595210517"></a>text</strong> component.</p>
</td>
</tr>
<tr id="r8bf92fd80ab14f6a824003dcc7f3008c"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="ab4ed51f180194575856b899947e2c4d4"><a name="ab4ed51f180194575856b899947e2c4d4"></a><a name="ab4ed51f180194575856b899947e2c4d4"></a>text-decoration</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="ab4048c7eccf046bab1dbdd33a0739e42"><a name="ab4048c7eccf046bab1dbdd33a0739e42"></a><a name="ab4048c7eccf046bab1dbdd33a0739e42"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a572fe437851c45b2a91c3748dbf3c0c3"><a name="a572fe437851c45b2a91c3748dbf3c0c3"></a><a name="a572fe437851c45b2a91c3748dbf3c0c3"></a>none</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a4e2f6f648ebc4d6d947a3edb6efe22fb"><a name="a4e2f6f648ebc4d6d947a3edb6efe22fb"></a><a name="a4e2f6f648ebc4d6d947a3edb6efe22fb"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="aa83ac8481649423b80b326de4eb5fefb"><a name="aa83ac8481649423b80b326de4eb5fefb"></a><a name="aa83ac8481649423b80b326de4eb5fefb"></a>Text decoration of the modified text. For details, see <a href="js-components-basic-text.md#section5775351116">text-decoration</a> of the <strong id="b1528363213719"><a name="b1528363213719"></a><a name="b1528363213719"></a>text</strong> component.</p>
</td>
</tr>
<tr id="rc154005d2ebf483faffebbe0a509770d"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.1.6.1.1 "><p id="a552bd7aa0bc94b118d88abf167e87a35"><a name="a552bd7aa0bc94b118d88abf167e87a35"></a><a name="a552bd7aa0bc94b118d88abf167e87a35"></a>font-family</p>
</td>
<td class="cellrowborder" valign="top" width="15.8015801580158%" headers="mcps1.1.6.1.2 "><p id="a0f5cc516346b4cbaa2d46c08bc340eeb"><a name="a0f5cc516346b4cbaa2d46c08bc340eeb"></a><a name="a0f5cc516346b4cbaa2d46c08bc340eeb"></a>string</p>
</td>
<td class="cellrowborder" valign="top" width="14.231423142314231%" headers="mcps1.1.6.1.3 "><p id="a959e67a1855241a1bb0898b2f57c7148"><a name="a959e67a1855241a1bb0898b2f57c7148"></a><a name="a959e67a1855241a1bb0898b2f57c7148"></a>sans-serif</p>
</td>
<td class="cellrowborder" valign="top" width="9.400940094009401%" headers="mcps1.1.6.1.4 "><p id="a2db078b3c8d64498af048fa12102a2a3"><a name="a2db078b3c8d64498af048fa12102a2a3"></a><a name="a2db078b3c8d64498af048fa12102a2a3"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="39.35393539353936%" headers="mcps1.1.6.1.5 "><p id="a52f159b549364d40b7c92d51aba7c1a9"><a name="a52f159b549364d40b7c92d51aba7c1a9"></a><a name="a52f159b549364d40b7c92d51aba7c1a9"></a>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 font specified by <a href="js-components-common-customizing-font.md">Custom Font Styles</a> is used for the text.</p>
</td>
</tr>
</tbody>
</table>
## Events<a name="section1319514265813"></a>
Only the click event in [Universal Events](js-components-common-events.md) is supported.
## Method<a name="section2291124515582"></a>
Not supported Not supported
## Example Code<a name="section1841815550582"></a>
``` ## Attributes
The [universal attributes](../arkui-js/js-components-common-attributes.md) are supported.
> **NOTE**
>
> The **focusable** and **disabled** attributes are not supported.
## Styles
Only the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| --------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | - | No | Font color of the modified text. |
| font-size | &lt;length&gt; | 30px | No | Font size of the modified text. |
| allow-scale | boolean | true | No | Whether the font size of the modified text changes with the system's font size settings.<br>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 modified text. For details, see **font-style** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| font-weight | number \| string | normal | No | Font weight of the modified text. For details, see **font-weight** of the [**\<text>**](../arkui-js/js-components-basic-text.md#styles) component.|
| text-decoration | string | none | No | Text decoration of the modified text. For details, see **text-decoration** of the [**\<text>**](../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
Only the click event in [Universal Events](../arkui-js/js-components-common-events.md) is supported.
## Methods
Not supported
## Example
```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
...@@ -135,7 +61,7 @@ Not supported ...@@ -135,7 +61,7 @@ Not supported
</div> </div>
``` ```
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
display: flex; display: flex;
...@@ -154,5 +80,4 @@ Not supported ...@@ -154,5 +80,4 @@ Not supported
} }
``` ```
![](figures/en-us_image_0000001152588626.png) ![en-us_image_0000001152588626](figures/en-us_image_0000001152588626.png)
# xcomponent # 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. > 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. The **\<xcomponent>** displays the components to which the EGL/OpenGLES or media data is written.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册