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

!4950 【OpenHarmony开源贡献者计划2022】ts API相关格式及表达问题

Merge pull request !4950 from king_he/0602-a
# Rating # Rating
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
...@@ -23,7 +23,7 @@ None ...@@ -23,7 +23,7 @@ None
Rating(options?: { rating: number, indicator?: boolean }) Rating(options?: { rating: number, indicator?: boolean })
- Parameters - Parameters
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| rating | number | Yes | 0 | Value to rate. | | rating | number | Yes | 0 | Value to rate. |
| indicator | boolean | No | false | Used only as an indicator and cannot be operated. | | indicator | boolean | No | false | Used only as an indicator and cannot be operated. |
...@@ -31,7 +31,7 @@ Rating(options?: { rating: number, indicator?: boolean }) ...@@ -31,7 +31,7 @@ Rating(options?: { rating: number, indicator?: boolean })
## Attributes ## Attributes
| Name | Type | Default Value | Description | | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| stars | number | 5 | Total number of stars. | | stars | number | 5 | Total number of stars. |
| stepSize | number | 0.5 | Step of an operation. | | stepSize | number | 0.5 | Step of an operation. |
...@@ -40,7 +40,7 @@ Rating(options?: { rating: number, indicator?: boolean }) ...@@ -40,7 +40,7 @@ Rating(options?: { rating: number, indicator?: boolean })
## Events ## Events
| Name | Description | | Name | Description |
| -------- | -------- | | -------- | -------- |
| onChange(callback:(value: number) =&gt; void) | Triggered when the rating value changes. | | onChange(callback:(value: number) =&gt; void) | Triggered when the rating value changes. |
......
# RichText # RichText
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<RichText>** component parses and displays HTML text. The **\<RichText>** component parses and displays HTML text.
...@@ -19,33 +19,33 @@ RichText\(content:string\) ...@@ -19,33 +19,33 @@ RichText\(content:string\)
- Parameters - Parameters
| Name| Type| Mandatory| Default Value| Description| | Name| Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| content | string | Yes| - | String in HTML format.| | content | string | Yes| - | Text string in HTML format. |
## Events ## Events
| Name| Description| | Name | Description|
| -------- | -------- | | -------- | -------- |
| onStart() => void | Triggered when web page loading starts.| | onStart() => void | Triggered when web page loading starts. |
| onComplete() => void | Triggered when web page loading is completed.| | onComplete() => void | Triggered when web page loading is completed. |
## Supported Tags ## Supported Tags
| Name| Description| Example| | Name | Description | Example |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| \<h1>--\<h6> | Defines six levels of headings in the HTML document. \<h1> defines the most important heading, and \<h6> defines the least important heading.| \<h1>This is an H1 heading\</h1> \<h2>This is an H2 heading\</h2>| | \<h1>--\<h6> | Defines six levels of headings in the HTML document. \<h1> defines the most important heading, and \<h6> defines the least important heading. | \<h1>This is an H1 heading\</h1> \<h2>This is an H2 heading\</h2> |
| \<p>\</p> | Defines a paragraph.| \<p>This is a paragraph\</p>| | \<p>\</p> | Defines a paragraph. | \<p>This is a paragraph\</p> |
| \<br/> | Inserts a newline character.| \<p>This is a paragraph\<br/>This is a new paragraph\</p>| | \<br/> | Inserts a newline character. | \<p>This is a paragraph\<br/>This is a new paragraph\</p>|
| \<hr/> | Defines a thematic break (such as a shift of topic) on an HTML page and creates a horizontal line.| \<p>This is a paragraph\</p>\<hr/>\<p>This is a paragraph\</p> | | \<hr/> | Defines a thematic break (such as a shift of topic) on an HTML page and creates a horizontal line. | \<p>This is a paragraph\</p>\<hr/>\<p>This is a paragraph\</p> |
| \<div>\</div> | Defines a generic container that is generally used to group block-level elements. It allows you to apply CSS styles to multiple elements at the same time.| \<div style='color:#0000FF'>\<h3>This is the heading in a div element\</h3>\</div> | | \<div>\</div> | Defines a generic container that is generally used to group block-level elements. It allows you to apply CSS styles to multiple elements at the same time. | \<div style='color:#0000FF'>\<h3>This is the heading in a div element\</h3>\</div> |
| \<i>\</i> | Displays text in italic style.| \<i>This is in italic style\</i> | | \<i>\</i> | Displays text in italic style. | \<i>This is in italic style\</i> |
| \<u>\</u> | Defines text that should be styled differently or have a non-textual annotation, such as misspelt words or a proper name in Chinese text. It is recommended that you avoid using the \<u> tag where it could be confused with a hyperlink.| \<p>\<u>This is an underlined paragraph\<u>\<p> | | \<u>\</u> | Defines text that should be styled differently or have a non-textual annotation, such as misspelt words or a proper name in Chinese text. It is recommended that you avoid using the \<u> tag where it could be confused with a hyperlink. | \<p>\<u>This is an underlined paragraph\<u>\<p> |
| \<style>\</style> | Used to embed CSS within an HTML document.| \<style>h1{color:red;}p{color:blue;}\</style> | | \<style>\</style> | Used to embed CSS within an HTML document. | \<style>h1{color:red;}p{color:blue;}\</style> |
| style | Defines the inline style of an element and is placed inside the tag. Use quotation marks (') to separate the styling text and use semicolons (;) to separate styles, for example, **style='width: 500px;height: 500px;border: 1px solid;margin: 0 auto;'**.| \<h1 style='color:blue;text-align:center'>This is a heading\</h1>\<p style='color:green'>This is a paragraph\</p> | | style | Defines the inline style of an element and is placed inside the tag. Use quotation marks (') to separate the styling text and use semicolons (;) to separate styles, for example, **style='width: 500px;height: 500px;border: 1px solid;margin: 0 auto;'**. | \<h1 style='color:blue;text-align:center'>This is a heading\</h1>\<p style='color:green'>This is a paragraph\</p> |
| \<script>\</script> | Used to embed or reference a client-side script, such as JavaScript.| \<script>document.write("Hello World!")\</script> | | \<script>\</script> | Used to embed or reference a client-side script, such as JavaScript. | \<script>document.write("Hello World!")\</script> |
## Example ## Example
......
# ScrollBar # ScrollBar
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
...@@ -23,29 +23,29 @@ This component can contain a single child component. ...@@ -23,29 +23,29 @@ This component can contain a single child component.
ScrollBar(value: ScrollBarOptions) ScrollBar(value: ScrollBarOptions)
- ScrollBarOptions parameters - ScrollBarOptions parameters
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| scroller | [Scroller](ts-container-scroll.md#scroller) | Yes | - | Scroller, which can be bound to and control scrollable components. | | scroller | [Scroller](ts-container-scroll.md#scroller) | Yes | - | Scroller, which can be bound to and control scrollable components. |
| direction | ScrollBarDirection | No | ScrollBarDirection.Vertical | Scrollbar direction in which scrollable components scroll. | | direction | ScrollBarDirection | No | ScrollBarDirection.Vertical | Scrollbar direction in which scrollable components scroll. |
| state | BarState | No | BarState.Auto | Scrollbar state. | | state | BarState | No | BarState.Auto | Scrollbar state. |
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> The **&lt;ScrollBar&gt;** component defines the behavior style of the scrollable area, and its subnodes define the behavior style of the scrollbar. > The **&lt;ScrollBar&gt;** component defines the behavior style of the scrollable area, and its subnodes define the behavior style of the scrollbar.
> >
> This component is bound to a scrollable component through **scroller**, and can be used to scroll the scrollable component only when their directions are the same. The **&lt;ScrollBar&gt;** component can be bound to only one scrollable component, and vice versa. > This component is bound to a scrollable component through **scroller**, and can be used to scroll the scrollable component only when their directions are the same. The **&lt;ScrollBar&gt;** component can be bound to only one scrollable component, and vice versa.
- ScrollBarDirection enums - ScrollBarDirection enums
| Name | Description | | Name | Description |
| -------- | -------- | | -------- | -------- |
| Vertical | Vertical scrollbar. | | Vertical | Vertical scrollbar. |
| Horizontal | Horizontal scrollbar. | | Horizontal | Horizontal scrollbar. |
- BarState enums - BarState enums
| Name | Description | | Name | Description |
| -------- | -------- | | -------- | -------- |
| On | Always display. | | On | Always display the scrollbar. |
| Off | Hide. | | Off | Hide the scrollbar. |
| Auto | Display on demand (displays when the screen is touched and disappears after 2s of inactivity). | | Auto | Display the scrollbar on demand (for example, display the scrollbar when the screen is touched or hide the scrollbar after 2s of inactivity). |
## Example ## Example
......
# Search # Search
> ![](public_sys-resources/icon-note.gif) **NOTE** This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. > **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<Search>** component provides an input area for users to search. The **\<Search>** component provides an input area for users to search.
...@@ -18,32 +19,32 @@ Search(options?: { value?: string; placeholder?: string; icon?: string; controll ...@@ -18,32 +19,32 @@ Search(options?: { value?: string; placeholder?: string; icon?: string; controll
- Parameters - Parameters
| Name| Type| Mandatory| Default Value| Description| | Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| value | string | No| - | Text input in the search text box.| | value | string | No| - | Text input in the search text box. |
| placeholder | string | No | - | Text displayed when there is no input.| | placeholder | string | No | - | Text displayed when there is no input. |
| icon | string | No| - | Path to the search icon. By default, the system search icon is used. The supported icon formats are svg, jpg, and png.| | icon | string | No| - | Path to the search icon. By default, the system search icon is used. The supported icon formats are svg, jpg, and png. |
| controller | SearchController | No| - | Controller.| | controller | SearchController | No| - | Controller. |
## Attributes ## Attributes
| Name| Type| Default Value| Description| | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| searchButton | string | –| Text on the search button located next to the search text box. By default, there is no search button.| | searchButton | string | –| Text on the search button located next to the search text box. By default, there is no search button. |
| placeholderColor | [ResourceColor](../../ui/ts-types.md) | - | Placeholder text color.| | placeholderColor | [ResourceColor](../../ui/ts-types.md) | - | Placeholder text color. |
| placeholderFont | [Font](../../ui/ts-types.md) | - | Placeholder text style.| | placeholderFont | [Font](../../ui/ts-types.md) | - | Placeholder text style. |
| textFont | [Font](../../ui/ts-types.md) | - | Text font for the search text box.| | textFont | [Font](../../ui/ts-types.md) | - | Text font for the search text box. |
## Events ## Events
| Name| Description| | Name | Description |
| -------- | -------- | | -------- | -------- |
| onSubmit(callback: (value: string) => void) | Triggered when users click the search icon or the search button, or tap the search button on a soft keyboard.<br> -**value**: current text input.| | onSubmit(callback: (value: string) => void) | Triggered when users click the search icon or the search button, or tap the search button on a soft keyboard.<br> -**value**: current text input. |
| onChange(callback: (value: string) => void) | Triggered when the input in the text box changes.<br> -**value**: current text input.| | onChange(callback: (value: string) => void) | Triggered when the input in the text box changes.<br> -**value**: current text input. |
| onCopy(callback: (value: string) => void) | Triggered when data is copied to the pasteboard.<br> -**value**: text copied.| | onCopy(callback: (value: string) => void) | Triggered when data is copied to the pasteboard.<br> -**value**: text copied. |
| onCut(callback: (value: string) => void) | Triggered when data is cut from the pasteboard.<br> -**value**: text cut.| | onCut(callback: (value: string) => void) | Triggered when data is cut from the pasteboard.<br> -**value**: text cut. |
| onPaste(callback: (value: string) => void) | Triggered when data is pasted from the pasteboard.<br> -**value**: text pasted.| | onPaste(callback: (value: string) => void) | Triggered when data is pasted from the pasteboard.<br> -**value**: text pasted. |
## SearchController ## SearchController
...@@ -61,9 +62,9 @@ Sets the position of the caret. ...@@ -61,9 +62,9 @@ Sets the position of the caret.
- Parameters - Parameters
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory | Default Value | Description |
| ---- | ------ | ---- | ---- | --------------------- | | ---- | ------ | ---- | ---- | --------------------- |
| value | number | Yes | - | Length from the start of the character string to the position where the caret is located.| | value | number | Yes | - | Length from the start of the character string to the position where the caret is located. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册