提交 13c639f5 编写于 作者: W wuzhihuitmac

Merge branch 'master' of gitee.com:openharmony/docs into wzh

Change-Id: I04981c956a63f4e4899328d2166aad70cdb537f1
...@@ -2717,7 +2717,7 @@ device.getServices().then(result => { ...@@ -2717,7 +2717,7 @@ device.getServices().then(result => {
readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void
Reads the characteristic value of the specific service of the peer BLE device. This API uses an asynchronous callback to return the result. Reads the characteristic value of the specific service of the remote BLE device. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.USE_BLUETOOTH **Required permissions**: ohos.permission.USE_BLUETOOTH
...@@ -2771,7 +2771,7 @@ device.readCharacteristicValue(characteristic, readCcc); ...@@ -2771,7 +2771,7 @@ device.readCharacteristicValue(characteristic, readCcc);
readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic> readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>
Reads the characteristic value of the specific service of the peer BLE device. This API uses a promise to return the result. Reads the characteristic value of the specific service of the remote BLE device. This API uses a promise to return the result.
**Required permissions**: ohos.permission.USE_BLUETOOTH **Required permissions**: ohos.permission.USE_BLUETOOTH
...@@ -2818,7 +2818,7 @@ device.readCharacteristicValue(characteristic); ...@@ -2818,7 +2818,7 @@ device.readCharacteristicValue(characteristic);
readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void
Reads the descriptor contained in the specific characteristic of the peer BLE device. This API uses an asynchronous callback to return the result. Reads the descriptor contained in the specific characteristic of the remote BLE device. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.USE_BLUETOOTH **Required permissions**: ohos.permission.USE_BLUETOOTH
...@@ -2862,7 +2862,7 @@ device.readDescriptorValue(descriptor, readDesc); ...@@ -2862,7 +2862,7 @@ device.readDescriptorValue(descriptor, readDesc);
readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor> readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>
Reads the descriptor contained in the specific characteristic of the peer BLE device. This API uses a promise to return the result. Reads the descriptor contained in the specific characteristic of the remote BLE device. This API uses a promise to return the result.
**Required permissions**: ohos.permission.USE_BLUETOOTH **Required permissions**: ohos.permission.USE_BLUETOOTH
......
...@@ -822,9 +822,9 @@ async function attestKey() { ...@@ -822,9 +822,9 @@ async function attestKey() {
properties: properties properties: properties
}; };
generateKey(aliasString); generateKey(aliasString);
setTimeout(()=>huks.attestKey(aliasString, options, function (err, data) { huks.attestKey(aliasString, options, function (err, data) {
printLog(`key attest result : ${JSON.stringify(data)}`); printLog(`key attest result : ${JSON.stringify(data)}`);
}), 1000); });
} }
``` ```
...@@ -894,8 +894,13 @@ async function attestKey() { ...@@ -894,8 +894,13 @@ async function attestKey() {
properties: properties properties: properties
}; };
generateKey(aliasString); generateKey(aliasString);
let result = await huks.exportKey(attestKey, options); huks.attestKey(aliasString, options)
printLog(`key attest result : ${result.errorCode}`); .then((data) => {
console.log(`test attestKey data: ${JSON.stringify(data)}`);
})
.catch((err) => {
console.log('test attestKey information: ' + JSON.stringify(err));
});
} }
``` ```
......
# WLAN # WLAN
The WLAN module provides basic wireless local area network (WLAN) functions, peer-to-peer (P2P) functions, and WLAN message notification services. It allows applications to communicate with other devices over WLAN. The **WLAN** module provides basic wireless local area network (WLAN) functions, peer-to-peer (P2P) functions, and WLAN message notification services. It allows applications to communicate with other devices over WLAN.
> **NOTE**<br> > **NOTE**<br>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -159,7 +159,7 @@ Represents WLAN hotspot information. ...@@ -159,7 +159,7 @@ Represents WLAN hotspot information.
| **Name**| **Type**| **Readable/Writable**| **Description**| | **Name**| **Type**| **Readable/Writable**| **Description**|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ssid | string | Read only| Hotspot service set identifier (SSID), in UTF-8 format.| | ssid | string | Read only| Service set identifier (SSID) of the hotspot, in UTF-8 format.|
| bssid | string | Read only| Basic service set identifier (BSSID) of the hotspot.| | bssid | string | Read only| Basic service set identifier (BSSID) of the hotspot.|
| capabilities | string | Read only| Hotspot capabilities.| | capabilities | string | Read only| Hotspot capabilities.|
| securityType | [WifiSecurityType](#wifisecuritytype) | Read only| WLAN security type.| | securityType | [WifiSecurityType](#wifisecuritytype) | Read only| WLAN security type.|
...@@ -207,7 +207,7 @@ Represents a WLAN information element. ...@@ -207,7 +207,7 @@ Represents a WLAN information element.
## WifiChannelWidth<sup>9+</sup> ## WifiChannelWidth<sup>9+</sup>
Enumerates the Wi-Fi channel widths. Enumerates the WLAN channel widths.
**System capability**: SystemCapability.Communication.WiFi.STA **System capability**: SystemCapability.Communication.WiFi.STA
...@@ -269,7 +269,7 @@ Represents the WLAN configuration. ...@@ -269,7 +269,7 @@ Represents the WLAN configuration.
| ssid | string | Read only| SSID of the hotspot, in UTF-8 format.| | ssid | string | Read only| SSID of the hotspot, in UTF-8 format.|
| bssid | string | Read only| BSSID of the hotspot.| | bssid | string | Read only| BSSID of the hotspot.|
| preSharedKey | string | Read only| PSK of the hotspot.| | preSharedKey | string | Read only| PSK of the hotspot.|
| isHiddenSsid | boolean | Read only| Whether to hide the network.| | isHiddenSsid | boolean | Read only| Whether the network is hidden.|
| securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.| | securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.|
| creatorUid | number | Read only| User ID, which is available only to system applications.| | creatorUid | number | Read only| User ID, which is available only to system applications.|
| disableReason | number | Read only| Reason for disabling WLAN. This parameter is available only to system applications.| | disableReason | number | Read only| Reason for disabling WLAN. This parameter is available only to system applications.|
...@@ -502,7 +502,7 @@ Adds the configuration of a candidate network. This API uses an asynchronous cal ...@@ -502,7 +502,7 @@ Adds the configuration of a candidate network. This API uses an asynchronous cal
## wifi.removeCandidateConfig<sup>9+</sup> ## wifi.removeCandidateConfig<sup>9+</sup>
removeCandidateConfig(config: WifiDeviceConfig): Promise&lt;boolean&gt; removeCandidateConfig(networkId: number): Promise&lt;void&gt;
Removes the configuration of a candidate network. This API uses a promise to return the result. Removes the configuration of a candidate network. This API uses a promise to return the result.
...@@ -513,17 +513,17 @@ Removes the configuration of a candidate network. This API uses a promise to ret ...@@ -513,17 +513,17 @@ Removes the configuration of a candidate network. This API uses a promise to ret
**Parameters** **Parameters**
| **Name**| **Type**| **Mandatory**| **Description**| | **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.| | networkId | number | Yes| ID of the network configuration to remove.|
**Return value** **Return value**
| **Type**| **Description**| | **Type**| **Description**|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.| | Promise&lt;void&gt; | Promise used to return the result.|
## wifi.removeCandidateConfig<sup>9+</sup> ## wifi.removeCandidateConfig<sup>9+</sup>
removeCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback&lt;boolean&gt;): void removeCandidateConfig(networkId: number, callback: AsyncCallback&lt;void&gt;): void
Removes the configuration of a candidate network. This API uses an asynchronous callback to return the result. Removes the configuration of a candidate network. This API uses an asynchronous callback to return the result.
...@@ -534,8 +534,8 @@ Removes the configuration of a candidate network. This API uses an asynchronous ...@@ -534,8 +534,8 @@ Removes the configuration of a candidate network. This API uses an asynchronous
**Parameters** **Parameters**
| **Name**| **Type**| **Mandatory**| **Description**| | **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.| | networkId | number | Yes| ID of the network configuration to remove.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
## wifi.getCandidateConfigs<sup>9+</sup> ## wifi.getCandidateConfigs<sup>9+</sup>
...@@ -625,7 +625,7 @@ This is a system API. ...@@ -625,7 +625,7 @@ This is a system API.
disconnect(): boolean disconnect(): boolean
Connects to the specified network. Disconnects from the specified network.
This is a system API. This is a system API.
**Required permissions**: **Required permissions**:
...@@ -721,7 +721,7 @@ Represents the WLAN connection information. ...@@ -721,7 +721,7 @@ Represents the WLAN connection information.
| Name| Type| Readable/Writable| Description| | Name| Type| Readable/Writable| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ssid | string | Read only| SSID, in UTF-8 format.| | ssid | string | Read only| SSID of the hotspot, in UTF-8 format.|
| bssid | string | Read only| BSSID of the hotspot.| | bssid | string | Read only| BSSID of the hotspot.|
| networkId | number | Read only| Network configuration ID, which is available only to system applications.| | networkId | number | Read only| Network configuration ID, which is available only to system applications.|
| rssi | number | Read only| RSSI of the hotspot, in dBm.| | rssi | number | Read only| RSSI of the hotspot, in dBm.|
...@@ -754,7 +754,7 @@ Enumerates the WLAN connection states. ...@@ -754,7 +754,7 @@ Enumerates the WLAN connection states.
| CONNECTED | 4 | A WLAN connection is established.| | CONNECTED | 4 | A WLAN connection is established.|
| DISCONNECTING | 5 | The WLAN connection is being disconnected.| | DISCONNECTING | 5 | The WLAN connection is being disconnected.|
| DISCONNECTED | 6 | The WLAN connection is disconnected.| | DISCONNECTED | 6 | The WLAN connection is disconnected.|
| UNKNOWN | 7 | Failed to set up a WLAN connection.| | UNKNOWN | 7 | Failed to set up the WLAN connection.|
## SuppState ## SuppState
...@@ -775,7 +775,7 @@ Enumerates the supplicant states. ...@@ -775,7 +775,7 @@ Enumerates the supplicant states.
| FOUR_WAY_HANDSHAKE | 7 | A four-way handshake is being performed for the supplicant.| | FOUR_WAY_HANDSHAKE | 7 | A four-way handshake is being performed for the supplicant.|
| GROUP_HANDSHAKE | 8 | A group handshake is being performed for the supplicant.| | GROUP_HANDSHAKE | 8 | A group handshake is being performed for the supplicant.|
| COMPLETED | 9 | The authentication is complete.| | COMPLETED | 9 | The authentication is complete.|
| UNINITIALIZED | 10 | The supplicant failed to set up a connection.| | UNINITIALIZED | 10 | The supplicant failed to set up the connection.|
| INVALID | 11 | Invalid value.| | INVALID | 11 | Invalid value.|
...@@ -809,7 +809,7 @@ This is a system API. ...@@ -809,7 +809,7 @@ This is a system API.
**Return value** **Return value**
| **Type**| **Description**| | **Type**| **Description**|
| -------- | -------- | | -------- | -------- |
| number | Feature value.| | number | Feature value. |
**Feature IDs** **Feature IDs**
...@@ -1031,7 +1031,7 @@ This is a system API. ...@@ -1031,7 +1031,7 @@ This is a system API.
removeDevice(id: number): boolean removeDevice(id: number): boolean
Removes the configuration of a network. Removes the specified network configuration.
This is a system API. This is a system API.
**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
...@@ -1147,10 +1147,10 @@ Represents the hotspot configuration. ...@@ -1147,10 +1147,10 @@ Represents the hotspot configuration.
| **Name**| **Type**| **Readable/Writable**| **Description**| | **Name**| **Type**| **Readable/Writable**| **Description**|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ssid | string | Read only| SSID, in UTF-8 format.| | ssid | string | Read only| SSID of the hotspot, in UTF-8 format.|
| securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.| | securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.|
| band | number | Read only| Hotspot band. The value **1** stands for 2.4 GHz, the value **2** for 5 GHz, and the value **3** for dual band.| | band | number | Read only| Hotspot band. The value **1** stands for 2.4 GHz, the value **2** for 5 GHz, and the value **3** for dual band.|
| preSharedKey | string | Read only| SPK of the hotspot.| | preSharedKey | string | Read only| PSK of the hotspot.|
| maxConn | number | Read only| Maximum number of connections allowed.| | maxConn | number | Read only| Maximum number of connections allowed.|
...@@ -1295,7 +1295,7 @@ Obtains the current P2P group information. This API uses an asynchronous callbac ...@@ -1295,7 +1295,7 @@ Obtains the current P2P group information. This API uses an asynchronous callbac
getP2pPeerDevices(): Promise&lt;WifiP2pDevice[]&gt; getP2pPeerDevices(): Promise&lt;WifiP2pDevice[]&gt;
Obtains the peer device list in a P2P connection. This API uses a promise to return the result. Obtains the peer device list in the P2P connection. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
...@@ -1311,7 +1311,7 @@ Obtains the peer device list in a P2P connection. This API uses a promise to ret ...@@ -1311,7 +1311,7 @@ Obtains the peer device list in a P2P connection. This API uses a promise to ret
getP2pPeerDevices(callback: AsyncCallback&lt;WifiP2pDevice[]&gt;): void getP2pPeerDevices(callback: AsyncCallback&lt;WifiP2pDevice[]&gt;): void
Obtains the peer device list in a P2P connection. This API uses an asynchronous callback to return the result. Obtains the peer device list in the P2P connection. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
...@@ -1357,7 +1357,7 @@ Enumerates the P2P device states. ...@@ -1357,7 +1357,7 @@ Enumerates the P2P device states.
getP2pLocalDevice(): Promise&lt;WifiP2pDevice&gt; getP2pLocalDevice(): Promise&lt;WifiP2pDevice&gt;
Obtains the local device information in a P2P connection. This API uses a promise to return the result. Obtains the local device information in the P2P connection. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
...@@ -1373,7 +1373,7 @@ Obtains the local device information in a P2P connection. This API uses a promis ...@@ -1373,7 +1373,7 @@ Obtains the local device information in a P2P connection. This API uses a promis
getP2pLocalDevice(callback: AsyncCallback&lt;WifiP2pDevice&gt;): void getP2pLocalDevice(callback: AsyncCallback&lt;WifiP2pDevice&gt;): void
Obtains the local device information in a P2P connection. This API uses an asynchronous callback to return the result. Obtains the local device information in the P2P connection. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
...@@ -1409,7 +1409,7 @@ Creates a P2P group. ...@@ -1409,7 +1409,7 @@ Creates a P2P group.
## WifiP2PConfig<sup>8+</sup> ## WifiP2PConfig<sup>8+</sup>
Represents P2P configuration. Represents P2P group configuration.
**System capability**: SystemCapability.Communication.WiFi.P2P **System capability**: SystemCapability.Communication.WiFi.P2P
...@@ -1465,7 +1465,7 @@ Sets up a P2P connection. ...@@ -1465,7 +1465,7 @@ Sets up a P2P connection.
| **Name**| **Type**| Mandatory| **Description**| | **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Connection configuration.| | config | [WifiP2PConfig](#wifip2pconfig8) | Yes| P2P group configuration.|
**Return value** **Return value**
| Type| Description| | Type| Description|
...@@ -1602,7 +1602,7 @@ Deletes a persistent group. ...@@ -1602,7 +1602,7 @@ Deletes a persistent group.
| **Name**| **Type**| Mandatory| **Description**| | **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| netId | number | Yes| ID of a group to delete.| | netId | number | Yes| ID of the group to delete.|
**Return value** **Return value**
| Type| Description| | Type| Description|
...@@ -1611,11 +1611,11 @@ Deletes a persistent group. ...@@ -1611,11 +1611,11 @@ Deletes a persistent group.
## wifi.getP2pGroups<sup>9+</sup> ## wifi.getP2pGroups<sup>9+</sup>
This is a system API.
getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt; getP2pGroups(): Promise&lt;Array&lt;WifiP2pGroupInfo&gt;&gt;
Obtains information about all P2P groups. This API uses a promise to return the result. Obtains information about all P2P groups. This API uses a promise to return the result.
This is a system API.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
......
# WLAN # WLAN
This **wifiext** module provides WLAN extension interfaces for non-universal products. This **wifiext** module provides WLAN extension interfaces for non-universal products.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br> > **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The APIs described in this document are used only for non-universal products, such as routers. The APIs described in this document are used only for non-universal products, such as routers.
...@@ -62,7 +62,7 @@ Obtains the supported power models. This API uses a promise to return the result ...@@ -62,7 +62,7 @@ Obtains the supported power models. This API uses a promise to return the result
## PowerModel ## PowerModel
Enumerates of the power models. Enumerates the power models.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension **System capability**: SystemCapability.Communication.WiFi.AP.Extension
...@@ -118,7 +118,7 @@ Obtains the power model. This API uses an asynchronous callback to return the re ...@@ -118,7 +118,7 @@ Obtains the power model. This API uses an asynchronous callback to return the re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[PowerModel](#powermodel)&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power mode obtained. If **err** is not **0**, an error has occurred.| | callback | AsyncCallback&lt;[PowerModel](#powermodel)&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power model obtained. If **err** is not **0**, an error has occurred.|
## wifiext.setPowerModel ## wifiext.setPowerModel
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
## Introduction<a name="section11660541593"></a> ## Introduction<a name="section11660541593"></a>
**About the Subsystem**
The Distributed Data Management subsystem can persistently store various structured data of a single device and also supports data synchronization and sharing across devices. In this regard, you can seamlessly integrate distributed application data among different devices, ensuring consistent user experience in the same application across these devices. The Distributed Data Management subsystem can persistently store various structured data of a single device and also supports data synchronization and sharing across devices. In this regard, you can seamlessly integrate distributed application data among different devices, ensuring consistent user experience in the same application across these devices.
- Local data management - Local data management
...@@ -16,9 +14,9 @@ The Distributed Data Management subsystem can persistently store various structu ...@@ -16,9 +14,9 @@ The Distributed Data Management subsystem can persistently store various structu
This service can synchronize data across devices, so that users can access consistent data on different devices. DDS isolates data based on a triplet of the account, app, and database. DDS synchronizes data between trusted devices to provide the cross-device data access capability. This service can synchronize data across devices, so that users can access consistent data on different devices. DDS isolates data based on a triplet of the account, app, and database. DDS synchronizes data between trusted devices to provide the cross-device data access capability.
**Architecture of the Subsystem** ## Architecture
**Figure 1** Architecture<a name="fig4460722185514"></a> **Figure 1** Architecture of the Distributed Data Management subsystem<a name="fig4460722185514"></a>
![](figures/en-us_image_0000001115748088.png) ![](figures/en-us_image_0000001115748088.png)
...@@ -51,7 +49,7 @@ third_party/ # Open-source software ...@@ -51,7 +49,7 @@ third_party/ # Open-source software
- **Result set** - **Result set**
A set of query results used to access the data. You can access the required data in a result set in flexible modes. A set of query results used to access data. You can access the required data in a result set in flexible modes.
- **SQLite database** - **SQLite database**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## 场景介绍 ## 场景介绍
HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自己的业务逻辑中的关键代码位置调用HiTraceMeter接口提供的API接口,能够有效踪进程轨迹、查看系统性能。 HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自己的业务逻辑中的关键代码位置调用HiTraceMeter接口提供的API接口,能够有效踪进程轨迹、查看系统性能。
## 接口说明 ## 接口说明
...@@ -12,15 +12,15 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自 ...@@ -12,15 +12,15 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自
| 接口名 | 返回值 | 描述 | | 接口名 | 返回值 | 描述 |
| ---------------------------------------------------------------------------- | --------- | ------------ | | ---------------------------------------------------------------------------- | --------- | ------------ |
| hiTraceMeter.startTrace(name: string, taskId: number, expectedTime?: number) | void | 标记一个预追踪耗时任务的开始。如果有多个相同name的任务需要追踪或者对同一个任务要追踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。如果具有相同name的任务是串行执行的,则taskId可以相同。 | | hiTraceMeter.startTrace(name: string, taskId: number, expectedTime?: number) | void | 标记一个预跟踪耗时任务的开始。如果有多个相同name的任务需要跟踪或者对同一个任务要跟踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。如果具有相同name的任务是串行执行的,则taskId可以相同。 |
| hiTraceMeter.finishTrace(name: string, taskId: number) | void | name和taskId必须与流程开始的hiTraceMeter.startTrace对应参数值保持一致。 | | hiTraceMeter.finishTrace(name: string, taskId: number) | void | name和taskId必须与流程开始的hiTraceMeter.startTrace对应参数值保持一致。 |
| hiTraceMeter.traceByValue(name: string, value: number) | void | 用来标记一个预踪的数值变量,该变量的数值会不断变化。| | hiTraceMeter.traceByValue(name: string, value: number) | void | 用来标记一个预踪的数值变量,该变量的数值会不断变化。|
## 开发步骤 ## 开发步骤
在应用启动执行页面加载后,开始分布式跟踪,完成业务之后,停止分布式跟踪。 在应用启动执行页面加载后,开始分布式跟踪,完成业务之后,停止分布式跟踪。
1. 新建一个JS应用工程,在“Project”窗口点击“entry > src > main > js > default > pages > index”,打开工程中的“index.js”文件,在页面执行加载后,在自己的业务中调用hiTraceMeter的接口,进行性能打点踪,示例代码如下: 1. 新建一个JS应用工程,在“Project”窗口点击“entry > src > main > js > default > pages > index”,打开工程中的“index.js”文件,在页面执行加载后,在自己的业务中调用hiTraceMeter的接口,进行性能打点踪,示例代码如下:
```js ```js
import hiTraceMeter from '@ohos.hiTraceMeter' import hiTraceMeter from '@ohos.hiTraceMeter'
...@@ -32,31 +32,31 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自 ...@@ -32,31 +32,31 @@ HiTraceMeter为开发者提供系统性能打点接口。开发者通过在自
onInit() { onInit() {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
//从startTrace到finishTrace流程的耗时期望为5ms // 从startTrace到finishTrace流程的耗时期望为5ms
hiTraceMeter.startTrace("business", 1); hiTraceMeter.startTrace("business", 1);
hiTraceMeter.startTrace("business", 1, 5); hiTraceMeter.startTrace("business", 1, 5);
//踪并行执行的同名任务 //踪并行执行的同名任务
hiTraceMeter.startTrace("business", 1); hiTraceMeter.startTrace("business", 1);
//业务流程 // 业务流程
console.log(`business running`); console.log(`business running`);
hiTraceMeter.startTrace("business", 2); //第二个追踪的任务开始,同时第一个追踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。 hiTraceMeter.startTrace("business", 2); // 第二个跟踪任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。
//业务流程 // 业务流程
console.log(`business running`); console.log(`business running`);
hiTraceMeter.finishTrace("business", 1); hiTraceMeter.finishTrace("business", 1);
//业务流程 // 业务流程
console.log(`business running`); console.log(`business running`);
hiTraceMeter.finishTrace("business", 2); hiTraceMeter.finishTrace("business", 2);
//踪串行执行的同名任务 //踪串行执行的同名任务
hiTraceMeter.startTrace("business", 1); hiTraceMeter.startTrace("business", 1);
//业务流程 // 业务流程
console.log(`business running`); console.log(`business running`);
hiTraceMeter.finishTrace("business", 1); //第一个追踪的任务结束 hiTraceMeter.finishTrace("business", 1); // 第一个跟踪的任务结束
//业务流程 // 业务流程
console.log(`business running`); console.log(`business running`);
hiTraceMeter.startTrace("business", 1); //第二个追踪的同名任务开始,同名的待追踪任务串行执行。 hiTraceMeter.startTrace("business", 1); // 第二个跟踪的同名任务开始,同名的待跟踪任务串行执行。
//业务流程 // 业务流程
console.log(`business running`); console.log(`business running`);
let traceCount = 3; let traceCount = 3;
......
# 性能打点跟踪概述 # 性能打点跟踪概述
hiTraceMeter是开发者用于踪进程轨迹,度量程序执行性能的一种工具,基于内核的ftrace机制,提供给用户态应用代码执行时长度量打点的能力。开发者通过使用hiTraceMeter API在程序中打点,并使用hiTraceMeter提供的命令行工具采集跟踪数据。 hiTraceMeter是开发者用于踪进程轨迹,度量程序执行性能的一种工具,基于内核的ftrace机制,提供给用户态应用代码执行时长度量打点的能力。开发者通过使用hiTraceMeter API在程序中打点,并使用hiTraceMeter提供的命令行工具采集跟踪数据。
## 基本概念 ## 基本概念
......
...@@ -780,7 +780,7 @@ distinct(): RdbPredicates ...@@ -780,7 +780,7 @@ distinct(): RdbPredicates
**示例:** **示例:**
```js ```js
let predicates = new data_rdb.RdbPredicates("EMPLOYEE") let predicates = new data_rdb.RdbPredicates("EMPLOYEE")
predicates.equalTo("NAME", "Rose").distinct("NAME") predicates.equalTo("NAME", "Rose").distinct()
``` ```
...@@ -1541,7 +1541,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A ...@@ -1541,7 +1541,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
**示例:** **示例:**
```js ```js
let predicates = new rdb.RdbPredicates('EPLOYEE') let predicates = new data_rdb.RdbPredicates('EPLOYEE')
predicates.greaterThan("id", 0) predicates.greaterThan("id", 0)
rdbStore.remoteQuery("deviceId", "EPLOYEE", predicates, function(err, resultSet){ rdbStore.remoteQuery("deviceId", "EPLOYEE", predicates, function(err, resultSet){
if (err) { if (err) {
...@@ -1579,7 +1579,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A ...@@ -1579,7 +1579,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
**示例:** **示例:**
```js ```js
let predicates = new rdb.RdbPredicates('EPLOYEE') let predicates = new data_rdb.RdbPredicates('EPLOYEE')
predicates.greaterThan("id", 0) predicates.greaterThan("id", 0)
let promise = rdbStore.remoteQuery("deviceId", "EMPLOYEE", predicates) let promise = rdbStore.remoteQuery("deviceId", "EMPLOYEE", predicates)
promise.then((resultSet) => { promise.then((resultSet) => {
......
# 性能打点 # 性能打点
本模块提供了踪进程轨迹,度量程序执行性能的打点能力。本模块打点的数据供hiTraceMeter工具分析使用。 本模块提供了踪进程轨迹,度量程序执行性能的打点能力。本模块打点的数据供hiTraceMeter工具分析使用。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...@@ -17,9 +17,9 @@ import hiTraceMeter from '@ohos.hiTraceMeter'; ...@@ -17,9 +17,9 @@ import hiTraceMeter from '@ohos.hiTraceMeter';
startTrace(name: string, taskId: number): void startTrace(name: string, taskId: number): void
标记一个预踪耗时任务的开始。 标记一个预踪耗时任务的开始。
如果有多个相同name的任务需要追踪或者对同一个任务要追踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。 如果有多个相同name的任务需要跟踪或者对同一个任务要跟踪多次,并且任务同时被执行,则每次调用startTrace的taskId不相同。
如果具有相同name的任务是串行执行的,则taskId可以相同。具体示例可参考[hiTraceMeter.finishTrace](#hitracemeterfinishtrace)中的示例。 如果具有相同name的任务是串行执行的,则taskId可以相同。具体示例可参考[hiTraceMeter.finishTrace](#hitracemeterfinishtrace)中的示例。
...@@ -29,7 +29,7 @@ startTrace(name: string, taskId: number): void ...@@ -29,7 +29,7 @@ startTrace(name: string, taskId: number): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| name | string | 是 | 要踪的任务名称 | | name | string | 是 | 要踪的任务名称 |
| taskId | number | 是 | 任务id | | taskId | number | 是 | 任务id |
**示例:** **示例:**
...@@ -43,7 +43,7 @@ hiTraceMeter.startTrace("myTestFunc", 1); ...@@ -43,7 +43,7 @@ hiTraceMeter.startTrace("myTestFunc", 1);
finishTrace(name: string, taskId: number): void finishTrace(name: string, taskId: number): void
标记一个预踪耗时任务的结束。 标记一个预踪耗时任务的结束。
finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemeterstarttrace)对应参数值一致。 finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemeterstarttrace)对应参数值一致。
...@@ -53,7 +53,7 @@ finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemetersta ...@@ -53,7 +53,7 @@ finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemetersta
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| name | string | 是 | 要踪的任务名称 | | name | string | 是 | 要踪的任务名称 |
| taskId | number | 是 | 任务id。 | | taskId | number | 是 | 任务id。 |
**示例:** **示例:**
...@@ -63,24 +63,24 @@ hiTraceMeter.finishTrace("myTestFunc", 1); ...@@ -63,24 +63,24 @@ hiTraceMeter.finishTrace("myTestFunc", 1);
``` ```
```js ```js
//踪并行执行的同名任务 //踪并行执行的同名任务
hiTraceMeter.startTrace("myTestFunc", 1); hiTraceMeter.startTrace("myTestFunc", 1);
//业务流程...... // 业务流程......
hiTraceMeter.startTrace("myTestFunc", 2); //第二个追踪的任务开始,同时第一个追踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。 hiTraceMeter.startTrace("myTestFunc", 2); // 第二个跟踪的任务开始,同时第一个跟踪的同名任务还没结束,出现了并行执行,对应接口的taskId需要不同。
//业务流程...... // 业务流程......
hiTraceMeter.finishTrace("myTestFunc", 1); hiTraceMeter.finishTrace("myTestFunc", 1);
//业务流程...... // 业务流程......
hiTraceMeter.finishTrace("myTestFunc", 2); hiTraceMeter.finishTrace("myTestFunc", 2);
``` ```
```js ```js
//踪串行执行的同名任务 //踪串行执行的同名任务
hiTraceMeter.startTrace("myTestFunc", 1); hiTraceMeter.startTrace("myTestFunc", 1);
//业务流程...... // 业务流程......
hiTraceMeter.finishTrace("myTestFunc", 1); //第一个追踪的任务结束 hiTraceMeter.finishTrace("myTestFunc", 1); // 第一个跟踪的任务结束
//业务流程...... // 业务流程......
hiTraceMeter.startTrace("myTestFunc", 1); //第二个追踪的同名任务开始,同名的待追踪任务串行执行。 hiTraceMeter.startTrace("myTestFunc", 1); // 第二个跟踪的同名任务开始,同名的待跟踪任务串行执行。
//业务流程...... // 业务流程......
hiTraceMeter.finishTrace("myTestFunc", 1); hiTraceMeter.finishTrace("myTestFunc", 1);
``` ```
...@@ -89,7 +89,7 @@ hiTraceMeter.finishTrace("myTestFunc", 1); ...@@ -89,7 +89,7 @@ hiTraceMeter.finishTrace("myTestFunc", 1);
traceByValue(name: string, count: number): void traceByValue(name: string, count: number): void
用来标记一个预踪的数值变量,该变量的数值会不断变化。 用来标记一个预踪的数值变量,该变量的数值会不断变化。
**系统能力:** SystemCapability.HiviewDFX.HiTrace **系统能力:** SystemCapability.HiviewDFX.HiTrace
...@@ -97,7 +97,7 @@ traceByValue(name: string, count: number): void ...@@ -97,7 +97,7 @@ traceByValue(name: string, count: number): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| name | string | 是 | 要踪的数值变量名称 | | name | string | 是 | 要踪的数值变量名称 |
| count | number | 是 | 变量的值 | | count | number | 是 | 变量的值 |
**示例:** **示例:**
......
...@@ -822,9 +822,9 @@ async function attestKey() { ...@@ -822,9 +822,9 @@ async function attestKey() {
properties: properties properties: properties
}; };
generateKey(aliasString); generateKey(aliasString);
setTimeout(()=>huks.attestKey(aliasString, options, function (err, data) { huks.attestKey(aliasString, options, function (err, data) {
printLog(`key attest result : ${JSON.stringify(data)}`); printLog(`key attest result : ${JSON.stringify(data)}`);
}), 1000); });
} }
``` ```
...@@ -894,8 +894,13 @@ async function attestKey() { ...@@ -894,8 +894,13 @@ async function attestKey() {
properties: properties properties: properties
}; };
generateKey(aliasString); generateKey(aliasString);
let result = await huks.exportKey(attestKey, options); huks.attestKey(aliasString, options)
printLog(`key attest result : ${result.errorCode}`); .then((data) => {
console.log(`test attestKey data: ${JSON.stringify(data)}`);
})
.catch((err) => {
console.log('test attestKey information: ' + JSON.stringify(err));
});
} }
``` ```
...@@ -1491,7 +1496,7 @@ finish操作密钥接口,使用Promise方式异步返回结果。 ...@@ -1491,7 +1496,7 @@ finish操作密钥接口,使用Promise方式异步返回结果。
| handle | number | 是 | Finish操作的handle。 | | handle | number | 是 | Finish操作的handle。 |
| options | [HuksOptions](#huksoptions) | 是 | Finish操作的参数集合。 | | options | [HuksOptions](#huksoptions) | 是 | Finish操作的参数集合。 |
| token | Uint8Array | 否 | Finish操作的token。 | | token | Uint8Array | 否 | Finish操作的token。 |
| promise | Promise\<[HuksResult](#Huksresult)> | 是 | promise实例,用于获取异步返回结果。 | | promise | Promise\<[HuksResult](#huksresult)> | 是 | promise实例,用于获取异步返回结果。 |
## huks.abort ## huks.abort
......
...@@ -909,7 +909,7 @@ createImageSource(uri: string): ImageSource ...@@ -909,7 +909,7 @@ createImageSource(uri: string): ImageSource
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ---------------------------------- | | ------ | ------ | ---- | ---------------------------------- |
| uri | string | 是 | 图片路径,当前仅支持应用沙箱路径。 | | uri | string | 是 | 图片路径,当前仅支持应用沙箱路径。</br>当前支持格式有:.jpg .png .gif .bmp .webp RAW。 |
**返回值:** **返回值:**
...@@ -936,7 +936,7 @@ createImageSource(uri: string, options: SourceOptions): ImageSource ...@@ -936,7 +936,7 @@ createImageSource(uri: string, options: SourceOptions): ImageSource
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------- | ---- | ----------------------------------- | | ------- | ------------------------------- | ---- | ----------------------------------- |
| uri | string | 是 | 图片路径,当前仅支持应用沙箱路径。 | | uri | string | 是 | 图片路径,当前仅支持应用沙箱路径。</br>当前支持格式有:.jpg .png .gif .bmp .webp RAW。 |
| options | [SourceOptions](#sourceoptions9) | 是 | 图片属性,包括图片序号与默认属性值。| | options | [SourceOptions](#sourceoptions9) | 是 | 图片属性,包括图片序号与默认属性值。|
**返回值:** **返回值:**
...@@ -2165,7 +2165,7 @@ img.release().then(() =>{ ...@@ -2165,7 +2165,7 @@ img.release().then(() =>{
| 名称 | 默认值 | 描述 | | 名称 | 默认值 | 描述 |
| --------------- | ------ | -------------------------------------------------- | | --------------- | ------ | -------------------------------------------------- |
| CENTER_CROP | 1 | 缩放图像以填充目标图像区域并居中裁剪区域外的效果。 | | CENTER_CROP | 1 | 缩放图像以填充目标图像区域并居中裁剪区域外的效果。 |
| FIT_TARGET_SIZE | 2 | 图像适合目标尺寸的效果。 | | FIT_TARGET_SIZE | 0 | 图像适合目标尺寸的效果。 |
## SourceOptions<sup>9+</sup> ## SourceOptions<sup>9+</sup>
...@@ -2230,7 +2230,7 @@ PixelMap的初始化选项。 ...@@ -2230,7 +2230,7 @@ PixelMap的初始化选项。
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
| ------- | ------ | ---- | ---- | --------------------------------------------------- | | ------- | ------ | ---- | ---- | --------------------------------------------------- |
| format | string | 是 | 是 | 目标格式。 | | format | string | 是 | 是 | 目标格式。</br>当前支持格式有:.jpg .png .gif .bmp .webp RAW。 |
| quality | number | 是 | 是 | JPEG编码中设定输出图片质量的参数,取值范围为1-100。 | | quality | number | 是 | 是 | JPEG编码中设定输出图片质量的参数,取值范围为1-100。 |
## GetImagePropertyOptions<sup>7+</sup> ## GetImagePropertyOptions<sup>7+</sup>
......
...@@ -16,7 +16,7 @@ import rpc from '@ohos.rpc'; ...@@ -16,7 +16,7 @@ import rpc from '@ohos.rpc';
## MessageParcel ## MessageParcel
该类提供读写基础类型及数组、IPC对象、接口描述符和自定义序列化对象的方法 在RPC过程中,发送方可以使用MessageParcel提供的写方法,将待发送的数据以特定格式写入该对象。接收方可以使用MessageParcel提供的读方法从该对象中读取特定格式的数据。数据格式包括:基础类型及数组、IPC对象、接口描述符和自定义序列化对象
### create ### create
...@@ -148,7 +148,7 @@ readRemoteObject(): IRemoteObject ...@@ -148,7 +148,7 @@ readRemoteObject(): IRemoteObject
writeInterfaceToken(token: string): boolean writeInterfaceToken(token: string): boolean
将接口描述符写入MessageParcel对象。 将接口描述符写入MessageParcel对象,远端对象可使用该信息校验本次通信
**系统能力**:SystemCapability.Communication.IPC.Core **系统能力**:SystemCapability.Communication.IPC.Core
...@@ -175,7 +175,7 @@ writeInterfaceToken(token: string): boolean ...@@ -175,7 +175,7 @@ writeInterfaceToken(token: string): boolean
readInterfaceToken(): string readInterfaceToken(): string
从MessageParcel中读取接口描述符。接口描述符按写入MessageParcel的顺序读取 从MessageParcel中读取接口描述符,接口描述符按写入MessageParcel的顺序读取,本地对象可使用该信息检验本次通信
**系统能力**:SystemCapability.Communication.IPC.Core **系统能力**:SystemCapability.Communication.IPC.Core
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ----------- | ---------- | ---- | ------- | --------------------------------- | | ----------- | ---------- | ---- | ------- | --------------------------------- |
| type | ButtonType | 否 | Capsule | 描述按钮风格。 | | type | ButtonType | 否 | ButtonType.Capsule | 描述按钮风格。 |
| stateEffect | boolean | 否 | true | 按钮按下时是否开启切换效果,当状态置为false时,点击效果关闭。 | | stateEffect | boolean | 否 | true | 按钮按下时是否开启切换效果,当状态置为false时,点击效果关闭。 |
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| ----------- | ---------- | ------- | --------------------------------- | | ----------- | ---------- | ------- | --------------------------------- |
| type | ButtonType | Capsule | 设置Button样式。 | | type | ButtonType | ButtonType.Capsule | 设置Button样式。 |
| stateEffect | boolean | true | 状态切换时是否开启切换效果,当状态置为false时,点击效果关闭。 | | stateEffect | boolean | true | 状态切换时是否开启切换效果,当状态置为false时,点击效果关闭。 |
- ButtonType枚举说明 - ButtonType枚举说明
......
...@@ -30,7 +30,7 @@ CheckboxGroup( group?: string ) ...@@ -30,7 +30,7 @@ CheckboxGroup( group?: string )
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| selectAll | boolean | false | 设置是否全选。 | | selectAll | boolean | false | 设置是否全选。 |
| selectedColor | Color | - | 设置被选中或部分选中状态的颜色。 | | selectedColor | [ResourceColor](../../ui/ts-types.md) | - | 设置被选中或部分选中状态的颜色。 |
## 事件 ## 事件
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口 ## 接口
DataPanel(value:{values: number[], max?: number, type?: DataPanelType}) DataPanel(options:{values: number[], max?: number, type?: DataPanelType})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
......
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
## 接口 ## 接口
DatePicker(options?: DatePickerOptions) DatePicker(options?: {start?: Date, end?: Date, selected?: Date})
根据指定范围的Date创建可以选择日期的滑动选择器。 根据指定范围的Date创建可以选择日期的滑动选择器。
- options参数 **参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| start | Date | 否 | Date('1970-1-1') | 指定选择器的起始日期。 | | start | Date | 否 | Date('1970-1-1') | 指定选择器的起始日期。 |
......
...@@ -28,8 +28,8 @@ Divider() ...@@ -28,8 +28,8 @@ Divider()
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| vertical | boolean | false | 使用水平分割线还是垂直分割线。false:水平分割线;true:垂直分割线。 | | vertical | boolean | false | 使用水平分割线还是垂直分割线。false:水平分割线;true:垂直分割线。 |
| color | [ResourceColor](../../ui/ts-types.md) | - | 分割线颜色。 | | color | [ResourceColor](../../ui/ts-types.md) | - | 分割线颜色。 |
| strokeWidth | Length | 1 | 分割线宽度。 | | strokeWidth | [Length](../../ui/ts-types.md) | 1 | 分割线宽度。 |
| lineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle枚举说明) | LineCapStyle.Butt | 分割线的端点样式。 | | lineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 分割线的端点样式。 |
## 事件 ## 事件
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
## 接口 ## 接口
Gauge(value:{value: number, min?: number, max?: number}) Gauge(options:{value: number, min?: number, max?: number})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
...@@ -37,9 +37,17 @@ Gauge(value:{value: number, min?: number, max?: number}) ...@@ -37,9 +37,17 @@ Gauge(value:{value: number, min?: number, max?: number})
| value | number | 0 | 设置当前数据图表的值。 | | value | number | 0 | 设置当前数据图表的值。 |
| startAngle | number | -150 | 设置起始角度位置,时钟0点为0度,顺时针方向为正角度。 | | startAngle | number | -150 | 设置起始角度位置,时钟0点为0度,顺时针方向为正角度。 |
| endAngle | number | 150 | 设置终止角度位置,时钟0点为0度,顺时针方向为正角度。 | | endAngle | number | 150 | 设置终止角度位置,时钟0点为0度,顺时针方向为正角度。 |
| colors | Array&lt;any&gt; | - | 设置图表的颜色,支持纯色和分段渐变色设置。 | | colors | Array&lt;ColorStop&gt; | - | 设置图表的颜色,支持分段颜色设置。 |
| strokeWidth | Length | - | 设置环形图表的环形厚度。 | | strokeWidth | Length | - | 设置环形图表的环形厚度。 |
## ColorStop
颜色断点类型,用于描述渐进色颜色断点。
| 名称 | 类型定义 | 描述 |
| --------- | -------------------- | ------------------------------------------------------------ |
| ColorStop | [ResourceColor](../../ui/ts-types.md#resourcecolor8),&nbsp;number] | 描述渐进色颜色断点类型,第一个参数为颜色值,第二个参数为0~1之间的比例值。 |
## 示例 ## 示例
......
...@@ -50,9 +50,13 @@ Image(src: string | PixelMap | Resource) ...@@ -50,9 +50,13 @@ Image(src: string | PixelMap | Resource)
| interpolation | [ImageInterpolation](#imageinterpolation) | ImageInterpolation.None | 设置图片的插值效果,即减轻低清晰度图片在放大显示的时候出现的锯齿问题,仅针对图片放大插值。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。<br/>>&nbsp;-&nbsp;PixelMap资源不支持该属性。 | | interpolation | [ImageInterpolation](#imageinterpolation) | ImageInterpolation.None | 设置图片的插值效果,即减轻低清晰度图片在放大显示的时候出现的锯齿问题,仅针对图片放大插值。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。<br/>>&nbsp;-&nbsp;PixelMap资源不支持该属性。 |
| renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 | | renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 |
| sourceSize | {<br/>width:&nbsp;number,<br/>height:&nbsp;number<br/>} | - | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。<br/>>&nbsp;**说明:**<br/>>&nbsp;PixelMap资源不支持该属性。 | | sourceSize | {<br/>width:&nbsp;number,<br/>height:&nbsp;number<br/>} | - | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。<br/>>&nbsp;**说明:**<br/>>&nbsp;PixelMap资源不支持该属性。 |
| matchTextDirection | boolean | false | 设置图片是否跟随系统语言方向,在RTL语言环境下显示镜像翻转显示效果。 |
| fitOriginalSize | boolean | true | 图片组件尺寸未设置时,其显示尺寸是否跟随图源尺寸。 |
| fillColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | - | 仅对svg图源生效,设置后会替换svg图片的fill颜色。 |
| autoResize | boolean | true | 是否需要在图片解码过程中对图源做resize操作,该操作会根据显示区域的尺寸决定用于绘制的图源尺寸,有利于减少内存占用。 |
| syncLoad<sup>8+</sup> | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 | | syncLoad<sup>8+</sup> | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 | | copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 |
| colorFilter<sup>9+</sup> | [ColorFilter](../../ui/ts-types.md) | - | 给图像设置颜色滤镜效果。 | | colorFilter<sup>9+</sup> | [ColorFilter](../../ui/ts-types.md#colorfilter9) | - | 给图像设置颜色滤镜效果。 |
### ImageInterpolation ### ImageInterpolation
...@@ -78,7 +82,7 @@ Image(src: string | PixelMap | Resource) ...@@ -78,7 +82,7 @@ Image(src: string | PixelMap | Resource)
| ---------------------------------------- | ---------------------------------------- | | ---------------------------------------- | ---------------------------------------- |
| onComplete(callback:&nbsp;(event?:&nbsp;{&nbsp;width:&nbsp;number,&nbsp;height:&nbsp;number,&nbsp;componentWidth:&nbsp;number,<br>&nbsp;componentHeight:&nbsp;number,&nbsp;loadingStatus:&nbsp;number&nbsp;})&nbsp;=&gt;&nbsp;void) | 图片成功加载时触发该回调,返回成功加载的图片尺寸。<br>- width:图片的宽,单位为像素。<br/>- height:图片的高,单位为像素。<br/>- componentWidth:组件的宽,单位为像素。<br/>- componentHeight:组件的高,单位为像素。<br/>- loadingStatus:图片加载成功的状态。<br/> | | onComplete(callback:&nbsp;(event?:&nbsp;{&nbsp;width:&nbsp;number,&nbsp;height:&nbsp;number,&nbsp;componentWidth:&nbsp;number,<br>&nbsp;componentHeight:&nbsp;number,&nbsp;loadingStatus:&nbsp;number&nbsp;})&nbsp;=&gt;&nbsp;void) | 图片成功加载时触发该回调,返回成功加载的图片尺寸。<br>- width:图片的宽,单位为像素。<br/>- height:图片的高,单位为像素。<br/>- componentWidth:组件的宽,单位为像素。<br/>- componentHeight:组件的高,单位为像素。<br/>- loadingStatus:图片加载成功的状态。<br/> |
| onError(callback:&nbsp;(event?:&nbsp;{&nbsp;componentWidth:&nbsp;number,&nbsp;componentHeight:&nbsp;number&nbsp;})&nbsp;=&gt;&nbsp;void) | 图片加载出现异常时触发该回调。<br>- componentWidth:组件的宽,单位为像素。<br/>- componentHeight:组件的高,单位为像素。<br/> | | onError(callback:&nbsp;(event?:&nbsp;{&nbsp;componentWidth:&nbsp;number,&nbsp;componentHeight:&nbsp;number&nbsp;})&nbsp;=&gt;&nbsp;void) | 图片加载出现异常时触发该回调。<br>- componentWidth:组件的宽,单位为像素。<br/>- componentHeight:组件的高,单位为像素。<br/> |
| onFinish(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 当加载的源文件为带动效的svg图片时,当svg动效播放完成时会触发这个回调,如果动效为无限循环动效,则不会触发这个回调。 | | onFinish(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 当加载的源文件为带动效的svg图片时,当svg动效播放完成时会触发这个回调,如果动效为无限循环动效,则不会触发这个回调。 |
## 示例 ## 示例
......
...@@ -50,11 +50,11 @@ ImageAnimator() ...@@ -50,11 +50,11 @@ ImageAnimator()
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onStart()&nbsp;=&gt;&nbsp;void | 状态回调,动画开始播放时触发。 | | onStart(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 状态回调,动画开始播放时触发。 |
| onPause()&nbsp;=&gt;&nbsp;void | 状态回调,动画暂停播放时触发。 | | onPause(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 状态回调,动画暂停播放时触发。 |
| onRepeat()&nbsp;=&gt;&nbsp;void | 状态回调,动画重新播放时触发。 | | onRepeat(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 状态回调,动画重新播放时触发。 |
| onCancel()&nbsp;=&gt;&nbsp;void | 状态回调,动画取消播放时触发。 | | onCancel(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 状态回调,动画取消播放时触发。 |
| onFinish()&nbsp;=&gt;&nbsp;void | 状态回调,动画播放完成时触发。 | | onFinish(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 状态回调,动画播放完成时触发。 |
## 示例 ## 示例
......
...@@ -36,9 +36,9 @@ Marquee(value: { start: boolean, step?: number, loop?: number, fromStart?: boole ...@@ -36,9 +36,9 @@ Marquee(value: { start: boolean, step?: number, loop?: number, fromStart?: boole
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onStart(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 开始滚动时触发回调。 | | onStart(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 开始滚动时触发回调。 |
| onBounce(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 滚动到底时触发回调。 | | onBounce(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 滚动到底时触发回调。 |
| onFinish(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 滚动完成时触发回调。 | | onFinish(event:&nbsp;()&nbsp;=&gt;&nbsp;void) | 滚动完成时触发回调。 |
## 示例 ## 示例
......
...@@ -30,9 +30,9 @@ Navigation() ...@@ -30,9 +30,9 @@ Navigation()
| -------------- | ---------------------------------------- | ------------------------ | ---------------------------------------- | | -------------- | ---------------------------------------- | ------------------------ | ---------------------------------------- |
| title | string&nbsp;\|&nbsp;[CustomBuilder](../../ui/ts-types.md) | - | 页面标题。 | | title | string&nbsp;\|&nbsp;[CustomBuilder](../../ui/ts-types.md) | - | 页面标题。 |
| subTitle | string | - | 页面副标题。 | | subTitle | string | - | 页面副标题。 |
| menus | Array<NavigationMenuItem&gt;&nbsp;\|&nbsp;[CustomBuilder](../../ui/ts-types.md) | - | 页面右上角菜单。 | | menus | Array<NavigationMenuItem&gt;&nbsp;\|&nbsp;[CustomBuilder](../../ui/ts-types.md)<sup>8+</sup> | - | 页面右上角菜单。 |
| titleMode | NavigationTitleMode | NavigationTitleMode.Free | 页面标题栏显示模式。 | | titleMode | NavigationTitleMode | NavigationTitleMode.Free | 页面标题栏显示模式。 |
| toolBar | {<br/>items:[<br/>Object<br/>]&nbsp;}<br/>\|&nbsp;[CustomBuilder](../../ui/ts-types.md) | - | 设置工具栏内容。<br/>items:&nbsp;工具栏所有项。 | | toolBar | {<br/>items:Array&lt;Object&gt;&nbsp;}<br/>\|&nbsp;[CustomBuilder](../../ui/ts-types.md#custombuilder8)<sup>8+</sup> | - | 设置工具栏内容。<br/>items:&nbsp;工具栏所有项。 |
| hideToolBar | boolean | false | 设置隐藏/显示工具栏:<br/>true:&nbsp;隐藏工具栏。<br/>false:&nbsp;显示工具栏。 | | hideToolBar | boolean | false | 设置隐藏/显示工具栏:<br/>true:&nbsp;隐藏工具栏。<br/>false:&nbsp;显示工具栏。 |
| hideTitleBar | boolean | false | 隐藏标题栏。 | | hideTitleBar | boolean | false | 隐藏标题栏。 |
| hideBackButton | boolean | false | 隐藏返回键。 | | hideBackButton | boolean | false | 隐藏返回键。 |
...@@ -44,7 +44,7 @@ Navigation() ...@@ -44,7 +44,7 @@ Navigation()
| icon | string | 否 | - | 菜单栏单个选项的图标资源路径。 | | icon | string | 否 | - | 菜单栏单个选项的图标资源路径。 |
| action | ()&nbsp;=&gt;&nbsp;void | 否 | - | 当前选项被选中的事件回调。 | | action | ()&nbsp;=&gt;&nbsp;void | 否 | - | 当前选项被选中的事件回调。 |
- Object类型接口说明 - Object类型说明
| 名称 | 类型 | 必填 | 默认值 | 描述 | | 名称 | 类型 | 必填 | 默认值 | 描述 |
| ------ | ----------------------- | ---- | ---- | --------------- | | ------ | ----------------------- | ---- | ---- | --------------- |
| value | string | 是 | - | 工具栏单个选项的显示文本。 | | value | string | 是 | - | 工具栏单个选项的显示文本。 |
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口说明 ## 接口说明
Progress(value: {value: number, total?: number, type?: ProgressType}) Progress(options: {value: number, total?: number, type?: ProgressType})
创建进度组件,用于显示内容加载或操作处理进度。 创建进度组件,用于显示内容加载或操作处理进度。
......
...@@ -39,7 +39,7 @@ Radio(options: {value: string, group: string}) ...@@ -39,7 +39,7 @@ Radio(options: {value: string, group: string})
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onChange(callback: (value: boolean) => void) | 单选框选中状态改变时触发回调。<br> -value为true时,代表选中。<br> -value为false时,代表未选中。 | | onChange(callback: (isChecked: boolean) => void) | 单选框选中状态改变时触发回调。<br> -isChecked为true时,代表选中。<br> -isChecked为false时,代表未选中。 |
## 示例 ## 示例
...@@ -56,8 +56,8 @@ struct RadioExample { ...@@ -56,8 +56,8 @@ struct RadioExample {
Radio({ value: 'Radio1', group: 'radioGroup' }).checked(true) Radio({ value: 'Radio1', group: 'radioGroup' }).checked(true)
.height(50) .height(50)
.width(50) .width(50)
.onChange((value: boolean) => { .onChange((isChecked: boolean) => {
console.log('Radio1 status is ' + value) console.log('Radio1 status is ' + isChecked)
}) })
} }
Column() { Column() {
...@@ -65,8 +65,8 @@ struct RadioExample { ...@@ -65,8 +65,8 @@ struct RadioExample {
Radio({ value: 'Radio2', group: 'radioGroup' }).checked(false) Radio({ value: 'Radio2', group: 'radioGroup' }).checked(false)
.height(50) .height(50)
.width(50) .width(50)
.onChange((value: boolean) => { .onChange((isChecked: boolean) => {
console.log('Radio2 status is ' + value) console.log('Radio2 status is ' + isChecked)
}) })
} }
Column() { Column() {
...@@ -74,8 +74,8 @@ struct RadioExample { ...@@ -74,8 +74,8 @@ struct RadioExample {
Radio({ value: 'Radio3', group: 'radioGroup' }).checked(false) Radio({ value: 'Radio3', group: 'radioGroup' }).checked(false)
.height(50) .height(50)
.width(50) .width(50)
.onChange((value: boolean) => { .onChange((isChecked: boolean) => {
console.log('Radio3 status is ' + value) console.log('Radio3 status is ' + isChecked)
}) })
} }
}.padding({ top: 30 }) }.padding({ top: 30 })
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
## 接口 ## 接口
RichText\(content:string\) RichText(content:string)
- 参数 - 参数
...@@ -29,8 +29,8 @@ RichText\(content:string\) ...@@ -29,8 +29,8 @@ RichText\(content:string\)
| 名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| onStart() => void | 加载网页时触发。 | | onStart(callback: () => void) | 加载网页时触发。 |
| onComplete() => void | 网页加载结束时触发。 | | onComplete(callback: () => void) | 网页加载结束时触发。 |
## 支持标签 ## 支持标签
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口 ## 接口
ScrollBar(value: ScrollBarOptions) ScrollBar(value: { scroller: Scroller, direction?: ScrollBarDirection, state?: BarState })
- ScrollBarOptions的参数描述 - ScrollBarOptions的参数描述
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
Select(options: Array\<SelectOption\>) Select(options: Array\<SelectOption\>)
- SelectOption参数 **SelectOption对象说明:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ----- | ----------------------------------- | ---- | ---- | ------- | | ----- | ----------------------------------- | ---- | ---- | ------- |
...@@ -42,7 +42,7 @@ Select(options: Array\<SelectOption\>) ...@@ -42,7 +42,7 @@ Select(options: Array\<SelectOption\>)
| 名称 | 功能描述 | | 名称 | 功能描述 |
| ---------------------------------------- | -------------------------------------- | | ---------------------------------------- | -------------------------------------- |
| onSelect(callback: (index: number, value?:string) => void | 下拉菜单选中某一项的回调。index:选中项的索引。value:选中项的值。 | | onSelect(callback: (index: number, value?:string) => void) | 下拉菜单选中某一项的回调。index:选中项的索引。value:选中项的值。 |
## 示例 ## 示例
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口 ## 接口
Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: SliderStyle, direction?: Axis}) Slider(options:{value?: number, min?: number, max?: number, step?: number, style?: SliderStyle, direction?: Axis, reverse?: boolean})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
...@@ -29,7 +29,7 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: ...@@ -29,7 +29,7 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?:
| max | number | 否 | 100 | 设置最大值。 | | max | number | 否 | 100 | 设置最大值。 |
| step | number | 否 | 1 | 设置Slider滑动跳动值,当设置相应的step时,Slider为间歇滑动。 | | step | number | 否 | 1 | 设置Slider滑动跳动值,当设置相应的step时,Slider为间歇滑动。 |
| style | SliderStyle | 否 | SliderStyle.OutSet | 设置Slider的滑块样式。 | | style | SliderStyle | 否 | SliderStyle.OutSet | 设置Slider的滑块样式。 |
| direction<sup>8+</sup> | [Axis](ts-appendix-enums.md#axis枚举说明) | 否 | Axis.Horizontal | 设置滑动条滑动方向为水平或竖直方向。 | | direction<sup>8+</sup> | [Axis](ts-appendix-enums.md#axis) | 否 | Axis.Horizontal | 设置滑动条滑动方向为水平或竖直方向。 |
| reverse<sup>8+</sup> | boolean | 否 | false | 设置滑动条取值范围是否反向。 | | reverse<sup>8+</sup> | boolean | 否 | false | 设置滑动条取值范围是否反向。 |
- SliderStyle枚举说明 - SliderStyle枚举说明
...@@ -45,11 +45,12 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: ...@@ -45,11 +45,12 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?:
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| blockColor | Color | - | 设置滑块的颜色。 | | blockColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | - | 设置滑块的颜色。 |
| trackColor | Color | - | 设置滑轨的背景颜色。 | | trackColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | - | 设置滑轨的背景颜色。 |
| selectedColor | Color | - | 设置滑轨的已滑动颜色。 | | selectedColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | - | 设置滑轨的已滑动颜色。 |
| showSteps | boolean | false | 设置当前是否显示步长刻度值。 | | showSteps | boolean | false | 设置当前是否显示步长刻度值。 |
| showTips | boolean | false | 设置滑动时是否显示气泡提示百分比。 | | showTips | boolean | false | 设置滑动时是否显示气泡提示百分比。 |
| trackThickness | [Length](../../ui/ts-types.md#length) | - | 设置滑轨的粗细。 |
## 事件 ## 事件
...@@ -58,7 +59,7 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: ...@@ -58,7 +59,7 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?:
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onChange(callback:&nbsp;(value:&nbsp;number,&nbsp;mode:&nbsp;SliderChangeMode)&nbsp;=&gt;&nbsp;void | Slider滑动时触发事件回调。<br/>value:当前进度值。<br/>mode:拖动状态。 | | onChange(callback:&nbsp;(value:&nbsp;number,&nbsp;mode:&nbsp;SliderChangeMode)&nbsp;=&gt;&nbsp;void) | Slider滑动时触发事件回调。<br/>value:当前进度值。<br/>mode:拖动状态。 |
- SliderChangeMode枚举说明 - SliderChangeMode枚举说明
| 名称 | 值 | 描述 | | 名称 | 值 | 描述 |
...@@ -66,6 +67,7 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: ...@@ -66,6 +67,7 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?:
| Begin | 0 | 用户开始拖动滑块。 | | Begin | 0 | 用户开始拖动滑块。 |
| Moving | 1 | 用户拖动滑块中。 | | Moving | 1 | 用户拖动滑块中。 |
| End | 2 | 用户结束拖动滑块。 | | End | 2 | 用户结束拖动滑块。 |
| Click | 3 | 用户点击滑动条使滑块位置移动。 |
## 示例 ## 示例
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
## 接口 ## 接口
Span(content: string) Span(content: ResourceStr)
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| content | string | 是 | - | 文本内容。 | | content | [ResourceStr](../../ui/ts-types.md#resourcestr8) | 是 | - | 文本内容。 |
## 属性 ## 属性
...@@ -32,8 +32,9 @@ Span(content: string) ...@@ -32,8 +32,9 @@ Span(content: string)
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| decoration | {<br/>type:&nbsp;[TextDecorationType](ts-appendix-enums.md#textdecorationtype枚举说明),<br/>color?:&nbsp;Color<br/>} | {<br/>type:&nbsp;TextDecorationType.None<br/>color:Color.Black<br/>} | 设置文本装饰线样式及其颜色。 | | decoration | {<br/>type:&nbsp;[TextDecorationType](ts-appendix-enums.md#textdecorationtype),<br/>color?:&nbsp;[ResourceColor](../../ui/ts-types.md#resourcecolor8)<br/>} | {<br/>type:&nbsp;TextDecorationType.None<br/>color:Color.Black<br/>} | 设置文本装饰线样式及其颜色。 |
| textCase | [TextCase](ts-appendix-enums.md#textcase枚举说明) | Normal | 设置文本大小写。 | | letterSpacing | [Length](../../ui/ts-types.md#length) | - | 设置文本字符间距。 |
| textCase | [TextCase](ts-appendix-enums.md#textcase) | Normal | 设置文本大小写。 |
## 事件 ## 事件
......
...@@ -40,6 +40,8 @@ Stepper(value?: { index?: number }) ...@@ -40,6 +40,8 @@ Stepper(value?: { index?: number })
| onFinish(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 步骤导航器最后一个StepperItem的nextLabel被点击时触发该回调&nbsp;。 | | onFinish(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 步骤导航器最后一个StepperItem的nextLabel被点击时触发该回调&nbsp;。 |
| onSkip(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 当前显示的StepperItem状态为ItemState.Skip时,nextLabel被点击时触发该回调。 | | onSkip(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | 当前显示的StepperItem状态为ItemState.Skip时,nextLabel被点击时触发该回调。 |
| onChange(callback:&nbsp;(prevIndex?:&nbsp;number,&nbsp;index?:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 点击左边或者右边文本按钮进行步骤切换时触发该事件。<br/>-&nbsp;prevIndex:切换前的步骤页索引值。<br/>-&nbsp;index:切换后的步骤页(前一页或者下一页)索引值。 | | onChange(callback:&nbsp;(prevIndex?:&nbsp;number,&nbsp;index?:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 点击左边或者右边文本按钮进行步骤切换时触发该事件。<br/>-&nbsp;prevIndex:切换前的步骤页索引值。<br/>-&nbsp;index:切换后的步骤页(前一页或者下一页)索引值。 |
| onNext(callback:&nbsp;(index?:&nbsp;number,&nbsp;pendingIndex?:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 点击切换下一步骤时触发该事件。<br/>-&nbsp;index:当前步骤页索引值。<br/>-&nbsp;pendingIndex:下一步骤页索引值。 |
| onPrevious(callback:&nbsp;(index?:&nbsp;number,&nbsp;pendingIndex?:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 点击切换上一步骤时触发该事件。<br/>-&nbsp;index:当前步骤页索引值。<br/>-&nbsp;pendingIndex:上一步骤页索引值。 |
## 示例 ## 示例
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
## 接口 ## 接口
Text(content?: string) Text(content?: ResourceStr)
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| content | string | 否 | '' | 文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。 | | content | [ResourceStr](../../ui/ts-types.md#resourcestr8) | 否 | '' | 文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。 |
## 属性 ## 属性
...@@ -33,9 +33,12 @@ Text(content?: string) ...@@ -33,9 +33,12 @@ Text(content?: string)
| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | TextAlign.Start | 设置多行文本的文本对齐方式。 | | textAlign | [TextAlign](ts-appendix-enums.md#textalign) | TextAlign.Start | 设置多行文本的文本对齐方式。 |
| textOverflow | {overflow:&nbsp;[TextOverflow](ts-appendix-enums.md#textoverflow)} | {overflow:&nbsp;TextOverflow.Clip} | 设置文本超长时的显示方式。<br/>**说明:**<br/>文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。<br />需配合`maxLines`使用,单独设置不生效。 | | textOverflow | {overflow:&nbsp;[TextOverflow](ts-appendix-enums.md#textoverflow)} | {overflow:&nbsp;TextOverflow.Clip} | 设置文本超长时的显示方式。<br/>**说明:**<br/>文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。<br />需配合`maxLines`使用,单独设置不生效。 |
| maxLines | number | Infinity | 设置文本的最大行数。<br />**说明:**<br />默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 `textOverflow`来指定截断方式。 | | maxLines | number | Infinity | 设置文本的最大行数。<br />**说明:**<br />默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 `textOverflow`来指定截断方式。 |
| lineHeight | Length | - | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。 | | lineHeight | string&nbsp;\|&nbsp;number&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md) | - | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。 |
| decoration | {<br/>type:&nbsp;[TextDecorationType](ts-appendix-enums.md#textdecorationtype),<br/>color?:&nbsp;Color<br/>} | {<br/>type:&nbsp;TextDecorationType.None,<br/>color: Color.Black<br/>} | 设置文本装饰线样式及其颜色。 | | decoration | {<br/>type:&nbsp;TextDecorationType,<br/>color?:&nbsp;[ResourceColor](../../ui/ts-types.md)<br/>} | {<br/>type:&nbsp;TextDecorationType.None,<br/>color:Color.Black<br/>} | 设置文本装饰线样式及其颜色。 |
| baselineOffset | Length | - | 设置文本基线的偏移量。 | | baselineOffset | [Length](../../ui/ts-types.md) | - | 设置文本基线的偏移量。 |
| letterSpacing | [Length](../../ui/ts-types.md) | - | 设置文本字符间距。 |
| minFontSize | number&nbsp;\|&nbsp;string&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md) | - | 设置文本最小显示字号。 |
| maxFontSize | number&nbsp;\|&nbsp;string&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md) | - | 设置文本最大显示字号。 |
| textCase | [TextCase](ts-appendix-enums.md#textcase) | TextCase.Normal | 设置文本大小写。 | | textCase | [TextCase](ts-appendix-enums.md#textcase) | TextCase.Normal | 设置文本大小写。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 | | copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 |
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
## 接口 ## 接口
TextArea(value?:{placeholder?: string| Resource, text?: string| Resource, controller?: TextAreaController}) TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: TextAreaController})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ----------------------- | ---------------------------------------- | ---- | ---- | -------------- | | ----------------------- | ---------------------------------------- | ---- | ---- | -------------- |
| placeholder | string \|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 否 | - | 无输入时的提示文本。 | | placeholder | [ResourceStr](../../ui/ts-types.md) | 否 | - | 无输入时的提示文本。 |
| text | string \|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 否 | - | 设置提示文本的当前值。 | | text | [ResourceStr](../../ui/ts-types.md) | 否 | - | 设置输入框当前的文本内容。 |
| controller<sup>8+</sup> | [TextAreaController](#textareacontroller8) | 否 | - | 设置TextArea控制器。 | | controller<sup>8+</sup> | [TextAreaController](#textareacontroller8) | 否 | - | 设置TextArea控制器。 |
......
...@@ -22,7 +22,7 @@ TextClock(options?: { timeZoneOffset?: number, controller?: TextClockController ...@@ -22,7 +22,7 @@ TextClock(options?: { timeZoneOffset?: number, controller?: TextClockController
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | ---- | ------------------ | ------------------------------------------------------------ | | -------- | -------- | ---- | ------------------ | ------------------------------------------------------------ |
| timeZoneOffset | number | 否 | 当前系统的时区偏移量 | 设置时区偏移量。<br>取值范围为[-14, 12],表示东十二区到西十二区,其中负值表示东时区,正值表示西时区,比如东八区为-8。<br>对横跨国际日界线的国家或地区,用-13(UTC+13)和-14(UTC+14)来保证整个国家或者区域处在相同的时间,当设置的值不在取值范围内时,将使用当前系统的时区偏移量。 | | timeZoneOffset | number | 否 | 当前系统的时区偏移量 | 设置时区偏移量。<br>取值范围为[-14, 12],表示东十二区到西十二区,其中负值表示东时区,正值表示西时区,比如东八区为-8。<br>对横跨国际日界线的国家或地区,用-13(UTC+13)和-14(UTC+14)来保证整个国家或者区域处在相同的时间,当设置的值不在取值范围内时,将使用当前系统的时区偏移量。 |
| contorller | [TextClockContorller](#textclockcontroller) | 否 | null | 绑定一个控制器,用来控制文本时钟的状态。| | controller | [TextClockController](#textclockcontroller) | 否 | null | 绑定一个控制器,用来控制文本时钟的状态。|
## 属性 ## 属性
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
## 接口 ## 接口
TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, controller?: TextInputController}) TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: TextInputController})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ----------------------- | ---------------------------------------- | ---- | ---- | --------------- | | ----------------------- | ---------------------------------------- | ---- | ---- | --------------- |
| placeholder | string&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 否 | - | 无输入时的提示文本。 | | placeholder | [ResourceStr](../../ui/ts-types.md) | 否 | - | 无输入时的提示文本。 |
| text | string&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 否 | - | 设置提示文本的当前值。 | | text | [ResourceStr](../../ui/ts-types.md) | 否 | - | 设置输入框当前的文本内容。 |
| controller<sup>8+</sup> | [TextInputController](#textinputcontroller8) | 否 | - | 设置TextInput控制器。 | | controller<sup>8+</sup> | [TextInputController](#textinputcontroller8) | 否 | - | 设置TextInput控制器。 |
...@@ -35,12 +35,12 @@ TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, con ...@@ -35,12 +35,12 @@ TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, con
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| ------------------------ | ---------------------------------------- | ----------------- | ---------------------------------------- | | ------------------------ | ---------------------------------------- | ----------------- | ---------------------------------------- |
| type | InputType | InputType.Normal | 设置输入框类型。 | | type | InputType | InputType.Normal | 设置输入框类型。 |
| placeholderColor | Color | - | 设置placeholder颜色。 | | placeholderColor | [ResourceColor](../../ui/ts-types.md) | - | 设置placeholder颜色。|
| placeholderFont | {<br/>size?:&nbsp;Length,<br/>weight?:&nbsp;number\|[FontWeight](ts-universal-attributes-text-style.md),<br/>family?:&nbsp;string,<br/>style?:&nbsp;[FontStyle](ts-universal-attributes-text-style.md)<br/>} | - | 设置placeholder文本样式:<br/>-&nbsp;size:&nbsp;设置文本尺寸,Length为number类型时,使用fp单位。<br/>-&nbsp;weight:&nbsp;设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。<br/>-&nbsp;family:&nbsp;设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial,&nbsp;sans-serif'。<br/>-&nbsp;style:&nbsp;设置文本的字体样式。 | | placeholderFont | {<br/>size?:&nbsp;Length,<br/>weight?:&nbsp;number\|[FontWeight](ts-universal-attributes-text-style.md),<br/>family?:&nbsp;string,<br/>style?:&nbsp;[FontStyle](ts-universal-attributes-text-style.md)<br/>} | - | 设置placeholder文本样式:<br/>-&nbsp;size:&nbsp;设置文本尺寸,Length为number类型时,使用fp单位。<br/>-&nbsp;weight:&nbsp;设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。<br/>-&nbsp;family:&nbsp;设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial,&nbsp;sans-serif'。<br/>-&nbsp;style:&nbsp;设置文本的字体样式。 |
| enterKeyType | EnterKeyType | EnterKeyType.Done | 设置输入法回车键类型。 | | enterKeyType | EnterKeyType | EnterKeyType.Done | 设置输入法回车键类型。 |
| caretColor | Color | - | 设置输入框光标颜色。 | | caretColor | [ResourceColor](../../ui/ts-types.md) | - | 设置输入框光标颜色。 |
| maxLength | number | - | 设置文本的最大输入字符数。 | | maxLength | number | - | 设置文本的最大输入字符数。 |
| inputFilter<sup>8+</sup> | {<br/>value:&nbsp;[ResourceStr](../../ui/ts-types.md)<sup>8+</sup>,<br/>error?:&nbsp;(value:&nbsp;string)<br/>} | - | 正则表达式,满足表达式的输入允许显示,不满足正则表达式的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,8到10位的强密码不支持过滤。<br/>-&nbsp;value:设置正则表达式。<br/>-&nbsp;error:正则匹配失败时,返回被忽略的内容。 | | inputFilter<sup>8+</sup> | {<br/>value:&nbsp;[ResourceStr](../../ui/ts-types.md)<sup>8+</sup>,<br/>error?:&nbsp;(value:&nbsp;string)&nbsp;=&gt;&nbsp;void<br/>} | - | 正则表达式,满足表达式的输入允许显示,不满足正则表达式的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,8到10位的强密码不支持过滤。<br/>-&nbsp;value:设置正则表达式。<br/>-&nbsp;error:正则匹配失败时,返回被忽略的内容。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-basic-components-text.md) | CopyOptions.CrossDevice | 设置文本是否可复制。 | | copyOption<sup>9+</sup> | [CopyOptions](ts-basic-components-text.md) | CopyOptions.CrossDevice | 设置文本是否可复制。 |
| showPasswordIcon<sup>9+</sup> | boolean | true | 密码输入模式时,密码框末尾的图标是否显示。 | | showPasswordIcon<sup>9+</sup> | boolean | true | 密码输入模式时,密码框末尾的图标是否显示。 |
| style<sup>9+</sup> | TextInputStyle | Default | TextInput风格。 | | style<sup>9+</sup> | TextInputStyle | Default | TextInput风格。 |
...@@ -48,19 +48,19 @@ TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, con ...@@ -48,19 +48,19 @@ TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, con
- EnterKeyType枚举说明 - EnterKeyType枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| ------------------- | --------- | | ------------------- | --------- |
| EnterKeyType.Go | 显示Go文本。 | | Go | 显示Go文本。 |
| EnterKeyType.Search | 显示为搜索样式。 | | Search | 显示为搜索样式。 |
| EnterKeyType.Send | 显示为发送样式。 | | Send | 显示为发送样式。 |
| EnterKeyType.Next | 显示为下一个样式。 | | Next | 显示为下一个样式。 |
| EnterKeyType.Done | 标准样式。 | | Done | 标准样式。 |
- InputType枚举说明 - InputType枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| ------------------ | ------------- | | ------------------ | ------------- |
| InputType.Normal | 基本输入模式。 | | Normal | 基本输入模式。 |
| InputType.Password | 密码输入模式。 | | Password | 密码输入模式。 |
| InputType.Email | e-mail地址输入模式。 | | Email | e-mail地址输入模式。 |
| InputType.Number | 纯数字输入模式。 | | Number | 纯数字输入模式。 |
- TextInputStyle枚举说明 - TextInputStyle枚举说明
| 名称 | 描述 | | 名称 | 描述 |
...@@ -72,7 +72,7 @@ TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, con ...@@ -72,7 +72,7 @@ TextInput(value?:{placeholder?: string | Resource, text?: string | Resource, con
| 名称 | 功能描述 | | 名称 | 功能描述 |
| ---------------------------------------- | ---------------------------------------- | | ---------------------------------------- | ---------------------------------------- |
| onChange(value:&nbsp;string)&nbsp;=&gt;&nbsp;void | 输入发生变化时,触发回调。 | | onChange(callback:&nbsp;(value:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 输入发生变化时,触发回调。 |
| onSubmit(callback:&nbsp;(enterKey:&nbsp;EnterKeyType)&nbsp;=&gt;&nbsp;void) | 回车键或者软键盘回车键触发该回调,参数为当前软键盘回车键类型。 | | onSubmit(callback:&nbsp;(enterKey:&nbsp;EnterKeyType)&nbsp;=&gt;&nbsp;void) | 回车键或者软键盘回车键触发该回调,参数为当前软键盘回车键类型。 |
| onEditChanged(callback:&nbsp;(isEditing:&nbsp;boolean)&nbsp;=&gt;&nbsp;void)<sup>(deprecated) </sup> | 输入状态变化时,触发回调。 | | onEditChanged(callback:&nbsp;(isEditing:&nbsp;boolean)&nbsp;=&gt;&nbsp;void)<sup>(deprecated) </sup> | 输入状态变化时,触发回调。 |
| onEditChange(callback:&nbsp;(isEditing:&nbsp;boolean)&nbsp;=&gt;&nbsp;void) <sup>8+</sup> | 输入状态变化时,触发回调。 | | onEditChange(callback:&nbsp;(isEditing:&nbsp;boolean)&nbsp;=&gt;&nbsp;void) <sup>8+</sup> | 输入状态变化时,触发回调。 |
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
## 接口 ## 接口
TextPicker(value: {range: string[] | Resource, value?: string, selected?: number}) TextPicker(options: {range: string[]|Resource, selected?: number, value?: string})
根据range指定的选择范围创建文本选择器。 根据range指定的选择范围创建文本选择器。
...@@ -26,8 +26,8 @@ TextPicker(value: {range: string[] | Resource, value?: string, selected?: number ...@@ -26,8 +26,8 @@ TextPicker(value: {range: string[] | Resource, value?: string, selected?: number
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| range | string[]&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 是 | - | 选择器的数据选择范围。 | | range | string[]&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 是 | - | 选择器的数据选择范围。 |
| value | string | 否 | - | 选中项文本值。当设置了selected参数时,该值不生效。如果该值不在range范围内,则默认取range第一个元素。| | selected | number | 否 | 0 | 选中项在数组中的index值。 |
| selected | number | 否 | 第一个元素 | 选中项在数组中的index值。 | | value | string | 否 | 第一个元素值 | 选中项的值,优先级低于selected。 |
## 属性 ## 属性
......
...@@ -25,7 +25,7 @@ TextTimer(options: { isCountDown?: boolean, count?: number, controller?: TextTim ...@@ -25,7 +25,7 @@ TextTimer(options: { isCountDown?: boolean, count?: number, controller?: TextTim
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| isCountDown | boolean | 否 | false | 是否倒计时。 | | isCountDown | boolean | 否 | false | 是否倒计时。 |
| count | number | 否 | 60000 | 倒计时时间(isCountDown为true时生效),单位为毫秒。<br/>-&nbsp;count&lt;=0时,使用默认值为倒计时初始值。<br/>-&nbsp;count&gt;0时,count值为倒计时初始值。 | | count | number | 否 | 60000 | 倒计时时间(isCountDown为true时生效),单位为毫秒。<br/>-&nbsp;count&lt;=0时,使用默认值为倒计时初始值。<br/>-&nbsp;count&gt;0时,count值为倒计时初始值。 |
| controller | [TextTimerController](#texttimercontroller) | 否 | null | TextTimer控制器。 | | controller | [TextTimerController](#texttimercontroller) | 否 | - | TextTimer控制器。 |
## 属性 ## 属性
...@@ -38,7 +38,7 @@ TextTimer(options: { isCountDown?: boolean, count?: number, controller?: TextTim ...@@ -38,7 +38,7 @@ TextTimer(options: { isCountDown?: boolean, count?: number, controller?: TextTim
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onTimer(callback:&nbsp;(utc:&nbsp;number,&nbsp;elapsedTime:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 时间文本发生变化时触发。<br/>utc:当前显示的时间,单位为毫秒。<br/>elapsedTime:计时器经过的时间,单位为毫秒。 | | onTimer(event:&nbsp;(utc:&nbsp;number,&nbsp;elapsedTime:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 时间文本发生变化时触发。<br/>utc:当前显示的时间,单位为毫秒。<br/>elapsedTime:计时器经过的时间,单位为毫秒。 |
## TextTimerController ## TextTimerController
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
## 子组件 ## 子组件
仅当ToggleType为Button时可包含子组件。
## 接口 ## 接口
...@@ -30,17 +30,17 @@ Toggle(options: { type: ToggleType, isOn?: boolean }) ...@@ -30,17 +30,17 @@ Toggle(options: { type: ToggleType, isOn?: boolean })
- ToggleType枚举说明 - ToggleType枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| Checkbox | 提供勾选框样式,子组件设置文本不生效,如需文本设置,可将Text和当前组件放入布局组件中<br>>&nbsp;**说明:**<br/>>&nbsp;[通用属性padding](ts-universal-attributes-size.md)的默认值为:<br>{<br>&nbsp;top: 14 vp,<br>&nbsp;right: 6 vp,<br>&nbsp;bottom: 14 vp,<br>&nbsp;left: 6 vp<br> } | | Checkbox | 提供单选框样式<br>>&nbsp;**说明:**<br/>>&nbsp;[通用属性padding](ts-universal-attributes-size.md)的默认值为:<br>{<br>&nbsp;top: 14 vp,<br>&nbsp;right: 6 vp,<br>&nbsp;bottom: 14 vp,<br>&nbsp;left: 6 vp<br> } |
| Button | 提供状态按钮样式,如果有文本设置,则相应的文本内容会显示在按钮内部。 | | Button | 提供状态按钮样式,如果子组件有文本设置,则相应的文本内容会显示在按钮内部。 |
| Switch | 提供开关样式,子组件设置文本不生效,如需文本设置,可将Text和当前组件放入布局组件中<br>>&nbsp;**说明:**<br/>>&nbsp;[通用属性padding](ts-universal-attributes-size.md)默认值为:<br>{<br/>&nbsp;top: 12 vp,<br/>&nbsp;right: 12 vp,<br/>&nbsp;bottom: 12 vp,<br/>&nbsp;left: 12 vp<br/> } | | Switch | 提供开关样式<br>>&nbsp;**说明:**<br/>>&nbsp;[通用属性padding](ts-universal-attributes-size.md)默认值为:<br>{<br/>&nbsp;top: 12 vp,<br/>&nbsp;right: 12 vp,<br/>&nbsp;bottom: 12 vp,<br/>&nbsp;left: 12 vp<br/> } |
## 属性 ## 属性
| 名称 | 参数 | 默认值 | 参数描述 | | 名称 | 参数 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| selectedColor | Color | - | 设置组件打开状态的背景颜色。 | | selectedColor | [ResourceColor](../../ui/ts-types.md) | - | 设置组件打开状态的背景颜色。 |
| switchPointColor | Color | - | 设置Switch类型的圆形滑块颜色。<br/>>&nbsp;**说明:**<br/>>&nbsp;仅对type为ToggleType.Switch生效。 | | switchPointColor | [ResourceColor](../../ui/ts-types.md) | - | 设置Switch类型的圆形滑块颜色。<br/>>&nbsp;**说明:**<br/>>&nbsp;仅对type为ToggleType.Switch生效。 |
## 事件 ## 事件
......
...@@ -16,12 +16,13 @@ ...@@ -16,12 +16,13 @@
## 接口 ## 接口
Web(options: { src: string, controller?: WebController }) Web(options: { src: ResourceStr, controller: WebController })
表1 options参数说明
**参数:** **参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ---------- | ------------------------------- | ---- | ---- | ------- | | ---------- | ------------------------------- | ---- | ---- | ------- |
| src | string | 是 | - | 网页资源地址。 | | src | [ResourceStr](../../ui/ts-types.md) | 是 | - | 网页资源地址。 |
| controller | [WebController](#webcontroller) | 否 | - | 控制器。 | | controller | [WebController](#webcontroller) | 否 | - | 控制器。 |
**示例:** **示例:**
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
## 接口 ## 接口
XComponent\(value: {id: string, type: string, libraryname?: string, controller?: XComponentController}\) XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController})
**参数:** **参数:**
......
...@@ -17,29 +17,30 @@ ...@@ -17,29 +17,30 @@
## 接口 ## 接口
AlphabetIndexer(value: {arrayValue : Array&lt;string&gt;, selected : number}) AlphabetIndexer(value: {arrayValue: Array&lt;string&gt;, selected: number})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| arrayValue | Array&lt;string&gt; | 是 | - | 字母索引字符串数组。 | | arrayValue | Array&lt;string&gt; | 是 | - | 字母索引字符串数组。 |
| selected | number | 是 | - | 选中项编号。 | | selected | number | 是 | - | 初始选中项索引值。 |
## 属性 ## 属性
| 名称 | 参数类型 | 描述 | | 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- | | ----------------------- | --------------- | ----------------------------------------------------------- |
| selectedColor | [ResourceColor](../../ui/ts-types.md) | 选中文本文字颜色。 | | color | [ResourceColor](../../ui/ts-types.md) | 设置文字颜色。 |
| popupColor | [ResourceColor](../../ui/ts-types.md) | 弹出提示文本字体颜色。 | | selectedColor | [ResourceColor](../../ui/ts-types.md) | 设置选中项文字颜色。 |
| selectedBackgroundColor | [ResourceColor](../../ui/ts-types.md) | 选中文本背景颜色。 | | popupColor | [ResourceColor](../../ui/ts-types.md) | 设置提示弹窗文字颜色。 |
| popupBackground | [ResourceColor](../../ui/ts-types.md) | 弹窗索引背景色。 | | selectedBackgroundColor | [ResourceColor](../../ui/ts-types.md) | 设置选中项背景颜色。 |
| usingPopup | boolean | 是否使用弹出索引提示。 | | popupBackground | [ResourceColor](../../ui/ts-types.md) | 设置提示弹窗背景色。 |
| selectedFont | {<br/>size?:&nbsp;number,<br/>weight?:&nbsp;FontWeight,<br/>family?:&nbsp;string,<br/>style?:&nbsp;FontStyle<br/>} | 选中文本文字样式。 | | usingPopup | boolean | 设置是否使用提示弹窗。 |
| popupFont | {<br/>size?:&nbsp;number,<br/>weight?:&nbsp;FontWeight,<br/>family?:&nbsp;string,<br/>style?:&nbsp;FontStyle<br/>} | 弹出提示文本字体样式。 | | selectedFont | [Font](../../ui/ts-types.md) | 设置选中项文字样式。 |
| font | {<br/>size?:&nbsp;number,<br/>weight?:&nbsp;FontWeight,<br/>family?:&nbsp;string,<br/>style?:&nbsp;FontStyle<br/>} | 字母索引条默认文本字体样式。 | | popupFont | [Font](../../ui/ts-types.md) | 设置提示弹窗字体样式。 |
| itemSize | Length | 字母索引条字母区域大小,字母区域为正方形,设置正方形边长。 | | font | [Font](../../ui/ts-types.md) | 设置字母索引条默认字体样式。 |
| alignStyle | IndexerAlign | 字母索引条对齐样式,支持左侧对齐样式与右侧对齐样式,影响弹窗弹出位置。 | | itemSize | Length | 设置字母索引条字母区域大小,字母区域为正方形,即正方形边长。 |
| alignStyle | IndexerAlign | 设置提示弹窗的弹出位置。 |
- IndexerAlign枚举说明 - IndexerAlign枚举说明
| 名称 | 描述 | | 名称 | 描述 |
...@@ -52,10 +53,10 @@ AlphabetIndexer(value: {arrayValue : Array&lt;string&gt;, selected : number}) ...@@ -52,10 +53,10 @@ AlphabetIndexer(value: {arrayValue : Array&lt;string&gt;, selected : number})
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onSelected(index:&nbsp;number)&nbsp;=&gt;&nbsp;void<sup>(deprecated) </sup>| 索引条选中回调。 | | onSelected(callback:&nbsp;(index:&nbsp;number)&nbsp;=&gt;&nbsp;void)<sup>(deprecated)</sup> | 索引条选中回调,返回值为当前选中索引。 |
| onSelect(index:&nbsp;number)&nbsp;=&gt;&nbsp;void<sup>8+</sup> | 索引条选中回调。 | | onSelect(callback:&nbsp;(index:&nbsp;number)&nbsp;=&gt;&nbsp;void)<sup>8+</sup> | 索引条选中回调,返回值为当前选中索引。 |
| onRequestPopupData(callback:&nbsp;(index:&nbsp;number)&nbsp;=&gt;&nbsp;Array&lt;string&gt;)<sup>8+</sup> | 选中字母索引后,请求索引提示窗口显示内容回调。<br/>返回值:索引对应的字符串数组,此字符串数组在弹出窗口中竖排显示,字符串列表最多显示5个,超出部分可以滑动显示。 | | onRequestPopupData(callback:&nbsp;(index:&nbsp;number)&nbsp;=&gt;&nbsp;Array&lt;string&gt;)<sup>8+</sup> | 选中字母索引后,请求索引提示弹窗显示内容回调。<br/>返回值:索引对应的字符串数组,此字符串数组在弹窗中竖排显示,字符串列表最多显示5个,超出部分可以滑动显示。 |
| onPopupSelect(callback:&nbsp;(index:&nbsp;number)&nbsp;=&gt;&nbsp;void)<sup>8+</sup> | 字母索引提示窗口选中回调。 | | onPopupSelect(callback:&nbsp;(index:&nbsp;number)&nbsp;=&gt;&nbsp;void)<sup>8+</sup> | 字母索引提示弹窗字符串列表选中回调。 |
## 示例 ## 示例
......
...@@ -18,26 +18,28 @@ ...@@ -18,26 +18,28 @@
## 接口 ## 接口
Badge(value: {count: number, position?: BadgePosition, maxCount?: number, style?: BadgeStyle}) 方法1:Badge(value: {count: number, position?: BadgePosition, maxCount?: number, style: BadgeStyle})
- 参数 创建数字标记组件。
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| count | number | 是 | - | 设置提醒消息数。 | | count | number | 是 | - | 设置提醒消息数。 |
| position | BadgePosition | 否 | BadgePosition.RightTop | 设置提示点显示位置。 | | position | BadgePosition | 否 | BadgePosition.RightTop | 设置提示点显示位置。 |
| maxCount | number | 否 | 99 | 最大消息数,超过最大消息时仅显示maxCount+。 | | maxCount | number | 否 | 99 | 最大消息数,超过最大消息时仅显示maxCount+。 |
| style | BadgeStyle | | - | Badge组件可设置样式,支持设置文本颜色、尺寸、圆点颜色和尺寸。 | | style | BadgeStyle | | - | Badge组件可设置样式,支持设置文本颜色、尺寸、圆点颜色和尺寸。 |
Badge(value: {value: string, position?: BadgePosition, style?: BadgeStyle}) 方法2: Badge(value: {value: string, position?: BadgePosition, style: BadgeStyle})
根据字符串创建提醒组件。 根据字符串创建标记组件。
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| value | string | 是 | - | 提示内容的文本字符串。 | | value | string | 是 | - | 提示内容的文本字符串。 |
| position | BadgePosition | 否 | BadgePosition.RightTop | 设置提示点显示位置。 | | position | BadgePosition | 否 | BadgePosition.RightTop | 设置提示点显示位置。 |
| style | BadgeStyle | | - | Badge组件可设置样式,支持设置文本颜色、尺寸、圆点颜色和尺寸。 | | style | BadgeStyle | | - | Badge组件可设置样式,支持设置文本颜色、尺寸、圆点颜色和尺寸。 |
- BadgeStyle对象说明 - BadgeStyle对象说明
| 名称 | 类型 | 必填 | 默认值 | 描述 | | 名称 | 类型 | 必填 | 默认值 | 描述 |
...@@ -50,8 +52,8 @@ Badge(value: {value: string, position?: BadgePosition, style?: BadgeStyle}) ...@@ -50,8 +52,8 @@ Badge(value: {value: string, position?: BadgePosition, style?: BadgeStyle})
- BadgePosition枚举说明 - BadgePosition枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| Right | 圆点显示在右侧纵向居中。 |
| RightTop | 圆点显示在右上角。 | | RightTop | 圆点显示在右上角。 |
| Right | 圆点显示在右侧纵向居中。 |
| Left | 圆点显示在左侧纵向居中。 | | Left | 圆点显示在左侧纵向居中。 |
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口 ## 接口
Column(value:{space?: Length}) Column(value?:{space?: Length})
- 参数 - 参数
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口 ## 接口
Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: FlexAlign, alignItems?: ItemAlign, alignContent?: FlexAlign }) Flex(value?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: FlexAlign, alignItems?: ItemAlign, alignContent?: FlexAlign })
标准Flex布局容器。 标准Flex布局容器。
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
Grid(scroller?: Scroller) Grid(scroller?: Scroller)
- 参数 **参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | --------- | ---------------------------------------- | ---- | --------------------------- | ----------------------- |
| scroller | [Scroller](ts-container-scroll.md#scroller) | 是 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 | | scroller | [Scroller](ts-container-scroll.md#scroller) | 否 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 |
## 属性 ## 属性
...@@ -36,19 +36,35 @@ Grid(scroller?: Scroller) ...@@ -36,19 +36,35 @@ Grid(scroller?: Scroller)
| rowsTemplate | string | '1fr' | 用于设置当前网格布局行的数量,不设置时默认1行&nbsp;示例,&nbsp;'1fr&nbsp;1fr&nbsp;2fr'分三行,将父组件允许的高分为4等份,第一行占1份,第二行占一份,第三行占2份。 | | rowsTemplate | string | '1fr' | 用于设置当前网格布局行的数量,不设置时默认1行&nbsp;示例,&nbsp;'1fr&nbsp;1fr&nbsp;2fr'分三行,将父组件允许的高分为4等份,第一行占1份,第二行占一份,第三行占2份。 |
| columnsGap | Length | 0 | 用于设置列与列的间距。 | | columnsGap | Length | 0 | 用于设置列与列的间距。 |
| rowsGap | Length | 0 | 用于设置行与行的间距。 | | rowsGap | Length | 0 | 用于设置行与行的间距。 |
| editMode<font color=ff0000><sup>8+</sup></font> | boolean | flase | 是否进入编辑模式,进入编辑模式可以拖拽Gird组件内部[GridItem](ts-container-griditem.md)。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 |
| layoutDirection<font color=ff0000><sup>8+</sup></font> | number | 0 |设置布局的主轴方向,目前支持的主轴布局方向如下:<br/>-&nbsp;0:主轴布局方向沿水平方向布局,即先填满一列,再去填下一列。 <br/>-&nbsp;1:主轴布局方向沿垂直方向布局,即先填满一行,再去填下一行。| | scrollBarColor | string&nbsp;\|&nbsp;number&nbsp;\|&nbsp;Color | - | 设置滚动条的颜色。 |
| maxCount<font color=ff0000><sup>8+</sup></font> | number | 1 | 当layoutDirection是Row时,表示可显示的最大行数<br/>当layoutDirection是Column时,表示可显示的最大列数。 | | scrollBarWidth | Length | - | 设置滚动条的宽度。 |
| minCount<font color=ff0000><sup>8+</sup></font> | number | 1 | 当layoutDirection是Row时,表示可显示的最小行数<br/>当layoutDirection是Column时,表示可显示的最小列数。 | | cachedCount | number | 1 | 设置预加载的GridItem的数量。 |
| cellLength<font color=ff0000><sup>8+</sup></font> | number | 0 | 当layoutDirection是Row时,表示一行的高度<br/>当layoutDirection是Column时,表示一列的宽度。 | | editMode <sup>8+</sup> | boolean | flase | 是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部[GridItem](ts-container-griditem.md)。 |
| multiSelectable<font color=ff0000><sup>8+</sup></font> | boolean | false | 是否开启鼠标框选。<br/>-&nbsp;false:关闭框选。<br/>-&nbsp;true:开启框选。 | | layoutDirection<sup>8+</sup> | GridDirection | GridDirection.Row | 设置布局的主轴方向。 |
| supportAnimation<font color=ff0000><sup>8+</sup></font> | boolean | false | 控制Grid是否支持动画。 | | maxCount<sup>8+</sup> | number | 1 | 当layoutDirection是Row/RowReverse时,表示可显示的最大行数<br/>当layoutDirection是Column/ColumnReverse时,表示可显示的最大列数。 |
| minCount<sup>8+</sup> | number | 1 | 当layoutDirection是Row/RowReverse时,表示可显示的最小行数。<br/>当layoutDirection是Column/ColumnReverse时,表示可显示的最小列数。 |
| cellLength<sup>8+</sup> | number | 0 | 当layoutDirection是Row/RowReverse时,表示一行的高度。<br/>当layoutDirection是Column/ColumnReverse时,表示一列的宽度。 |
| multiSelectable<sup>8+</sup> | boolean | false | 是否开启鼠标框选。<br/>-&nbsp;false:关闭框选。<br/>-&nbsp;true:开启框选。 |
| supportAnimation<sup>8+</sup> | boolean | false | 是否支持动画。 |
## 事件 ## 事件
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onScrollIndex(first:&nbsp;number)&nbsp;=&gt;&nbsp;void | 当前列表显示的起始位置item发生变化时触发。 | | onScrollIndex(event: (first: number) => void) | 当前网格显示的起始位置item发生变化时触发,返回值为当前显示的网格起始位置的索引值。 |
| onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => (() => any) \| void) | 开始拖拽网格元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为被拖拽网格元素索引值。 |
| onItemDragEnter(event: (event: ItemDragInfo) => void) | 拖拽进入网格元素范围内时触发,返回值event见ItemDragInfo对象说明。 |
| onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | 拖拽在网格元素范围内移动时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽起始位置,insertIndex为拖拽插入位置。 |
| onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void) | 拖拽离开网格元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽离开的网格元素索引值。 |
| onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | 绑定该事件的网格元素可作为拖拽释放目标,当在网格元素内停止拖拽时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽起始位置,insertIndex为拖拽插入位置,isSuccess为是否成功释放。 |
## ItemDragInfo对象说明
| 名称 | 类型 | 描述 |
| ---------- | ---------- | ---------- |
| x | number | 当前拖拽点的x坐标。 |
| y | number | 当前拖拽点的y坐标。 |
## 示例 ## 示例
......
...@@ -38,7 +38,7 @@ GridItem() ...@@ -38,7 +38,7 @@ GridItem()
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onSelect(callback:&nbsp;(isSelected:&nbsp;boolean)&nbsp;=&gt;&nbsp;any)<sup>8+</sup> | GridItem元素被鼠标框选的状态改变时触发回调。<br/>isSelected:进入鼠标框选范围即被选中返回true,&nbsp;移出鼠标框选范围即未被选中返回false。 | | onSelect(callback:&nbsp;(isSelected:&nbsp;boolean)&nbsp;=&gt;&nbsp;void)<sup>8+</sup> | GridItem元素被鼠标框选的状态改变时触发回调。<br/>isSelected:进入鼠标框选范围即被选中返回true,&nbsp;移出鼠标框选范围即未被选中返回false。 |
## 示例 ## 示例
......
...@@ -26,7 +26,7 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} ...@@ -26,7 +26,7 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| space | number&nbsp;\|&nbsp;string | 否 | 0 | 列表项间距。 | | space | [Length](../../ui/ts-types.md#length) | 否 | 0 | 列表项间距。 |
| initialIndex | number | 否 | 0 | 设置当前List初次加载时视口起始位置显示的item,即显示第一个item,如设置的序号超过了最后一个item的序号,则设置不生效。 | | initialIndex | number | 否 | 0 | 设置当前List初次加载时视口起始位置显示的item,即显示第一个item,如设置的序号超过了最后一个item的序号,则设置不生效。 |
| scroller | [Scroller](ts-container-scroll.md#scroller) | 否 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 | | scroller | [Scroller](ts-container-scroll.md#scroller) | 否 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 |
...@@ -36,7 +36,9 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} ...@@ -36,7 +36,9 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| listDirection | [Axis](ts-appendix-enums.md#axis) | Vertical | 设置List组件排列方向参照Axis枚举说明。 | | listDirection | [Axis](ts-appendix-enums.md#axis) | Vertical | 设置List组件排列方向参照Axis枚举说明。 |
| divider | {<br/>strokeWidth:&nbsp;Length,<br/>color?:Color,<br/>startMargin?:&nbsp;Length,<br/>endMargin?:&nbsp;Length<br/>} | - | 用于设置ListItem分割线样式,默认无分割线。<br/>strokeWidth:&nbsp;分割线的线宽。<br/>color:&nbsp;分割线的颜色。<br/>startMargin:&nbsp;分割线距离列表侧边起始端的距离。<br/>endMargin:&nbsp;分割线距离列表侧边结束端的距离。 | | divider | {<br/>strokeWidth:&nbsp;Length,<br/>color?:[ResourceColor](../../ui/ts-types.md),<br/>startMargin?:&nbsp;Length,<br/>endMargin?:&nbsp;Length<br/>} | - | 用于设置ListItem分割线样式,默认无分割线。<br/>strokeWidth:&nbsp;分割线的线宽。<br/>color:&nbsp;分割线的颜色。<br/>startMargin:&nbsp;分割线距离列表侧边起始端的距离。<br/>endMargin:&nbsp;分割线距离列表侧边结束端的距离。 |
| scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 |
| cachedCount | number | 1 | 设置预加载的ListItem的数量。 |
| editMode | boolean | false | 声明当前List组件是否处于可编辑模式。 | | editMode | boolean | false | 声明当前List组件是否处于可编辑模式。 |
| edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 | | edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 |
| chainAnimation | boolean | false | 用于设置当前list是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:list内的list-item间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。<br/>-&nbsp;false:不启用链式联动。<br/>-&nbsp;true:启用链式联动。 | | chainAnimation | boolean | false | 用于设置当前list是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:list内的list-item间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。<br/>-&nbsp;false:不启用链式联动。<br/>-&nbsp;true:启用链式联动。 |
...@@ -68,9 +70,26 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} ...@@ -68,9 +70,26 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onItemDelete(index:&nbsp;number)&nbsp;=&gt;&nbsp;boolean | 列表项删除时触发。 | | onItemDelete(event: (index: number) => boolean) | 列表项删除时触发。 |
| onScrollBegin<sup>9+</sup>(dx: number, dy: number)&nbsp;=&gt;&nbsp;{ dxRemain: number, dyRemain: number } | 滚动开始事件回调。<br>参数:<br>- dx:即将发生的水平方向滚动量。<br>- dy:即将发生的竖向方向滚动量。<br>返回值:<br>- dxRemain:水平方向滚动剩余量。<br>- dyRemain:竖直方向滚动剩余量。 | | onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void) | 列表滑动时触发,返回值scrollOffset为滑动偏移量,scrollState为当前滑动状态。 |
| onScrollIndex(firstIndex:&nbsp;number,&nbsp;lastIndex:&nbsp;number)&nbsp;=&gt;&nbsp;void | 当前列表显示的起始位置和终止位置发生变化时触发。 | | onScrollIndex(event: (start: number, end: number) => void) | 列表滑动时触发,返回值分别为滑动起始位置索引值与滑动结束位置索引值。 |
| onReachStart(event: () => void) | 列表到达起始位置时触发。 |
| onReachEnd(event: () => void) | 列表到底末尾位置时触发。 |
| onScrollStop(event: () => void) | 列表滑动停止时触发。 |
| onItemMove(event: (from: number, to: number) => boolean) | 列表元素发生移动时触发,返回值from、to分别为移动前索引值与移动后索引值。 |
| onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => (() => any) \| void) | 开始拖拽列表元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为被拖拽列表元素索引值。 |
| onItemDragEnter(event: (event: ItemDragInfo) => void) | 拖拽进入列表元素范围内时触发,返回值event见ItemDragInfo对象说明。 |
| onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | 拖拽在列表元素范围内移动时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽起始位置,insertIndex为拖拽插入位置。 |
| onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void) | 拖拽离开列表元素时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽离开的列表元素索引值。 |
| onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发,返回值event见ItemDragInfo对象说明,itemIndex为拖拽起始位置,insertIndex为拖拽插入位置,isSuccess为是否成功释放。 |
## ScrollState枚举说明
| 名称 | 描述 |
| ------ | ------------------------- |
| Idle | 未滑动状态。 |
| Scroll | 惯性滑动状态。 |
| Fling | 手指拖动状态。 |
> **说明:** > **说明:**
> List使能可编辑模式需配合onItemDelete事件和ListItem的editable属性,即可编辑模式实现删除列表项功能,需满足以下条件: > List使能可编辑模式需配合onItemDelete事件和ListItem的editable属性,即可编辑模式实现删除列表项功能,需满足以下条件:
......
...@@ -27,17 +27,26 @@ ListItem() ...@@ -27,17 +27,26 @@ ListItem()
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| sticky | Sticky | Sticky.None | 设置ListItem吸顶效果,参见Sticky枚举描述。 | | sticky | Sticky | Sticky.None | 设置ListItem吸顶效果,参见Sticky枚举描述。 |
| editable | boolean | false | 当前ListItem元素是否可编辑,进入编辑模式后可删除。 | | editable | boolean&nbsp;\|&nbsp;EditMode | false | 当前ListItem元素是否可编辑,进入编辑模式后可删除或移动。 |
| selectable<sup>8+</sup> | boolean | true | 当前ListItem元素是否可以被鼠标框选。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;外层List容器的鼠标框选开启时,ListItem的框选才生效。 | | selectable<sup>8+</sup> | boolean | true | 当前ListItem元素是否可以被鼠标框选。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;外层List容器的鼠标框选开启时,ListItem的框选才生效。 |
| swipeAction<sup>9+</sup> | {<br/>start?:&nbsp;CustomBuilder,<br/>end?:CustomBuilder,<br/>edgeEffect?:&nbsp;SwipeEdgeEffect,<br/>} | - | 用于设置ListItem的划出组件。<br/>start:&nbsp;ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。<br/>end:&nbsp;ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。<br/>edgeEffect:&nbsp;滑动效果,参见SwipeEdgeEffect的枚举说明。<br/> | | swipeAction<sup>9+</sup> | {<br/>start?:&nbsp;CustomBuilder,<br/>end?:CustomBuilder,<br/>edgeEffect?:&nbsp;SwipeEdgeEffect,<br/>} | - | 用于设置ListItem的划出组件。<br/>start:&nbsp;ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。<br/>end:&nbsp;ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。<br/>edgeEffect:&nbsp;滑动效果,参见SwipeEdgeEffect的枚举说明。<br/> |
- Sticky枚举说明 ## Sticky枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| None | 无吸顶效果。 | | None | 无吸顶效果。 |
| Normal | 当前item吸顶。 | | Normal | 当前item吸顶。 |
| Opacity | 当前item吸顶显示透明度变化效果。 |
- SwipeEdgeEffect<sup>9+</sup>枚举说明 ## EditMode枚举说明
| 名称 | 描述 |
| ------ | --------- |
| None | 编辑操作不限制。 |
| Deletable | 可删除。 |
| Movable | 可移动。 |
## SwipeEdgeEffect<sup>9+</sup>枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| Spring | ListItem划动距离超过划出组件大小后可以继续划动,松手后按照弹簧阻尼曲线回弹。 | | Spring | ListItem划动距离超过划出组件大小后可以继续划动,松手后按照弹簧阻尼曲线回弹。 |
...@@ -47,7 +56,7 @@ ListItem() ...@@ -47,7 +56,7 @@ ListItem()
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onSelect(callback:&nbsp;(isSelected:&nbsp;boolean)&nbsp;=&gt;&nbsp;any)<sup>8+</sup> | ListItem元素被鼠标框选的状态改变时触发回调。<br/>isSelected:进入鼠标框选范围即被选中返回true,&nbsp;移出鼠标框选范围即未被选中返回false。 | | onSelect(event:&nbsp;(isSelected:&nbsp;boolean)&nbsp;=&gt;&nbsp;void)<sup>8+</sup> | ListItem元素被鼠标框选的状态改变时触发回调。<br/>isSelected:进入鼠标框选范围即被选中返回true,&nbsp;移出鼠标框选范围即未被选中返回false。 |
## 示例 ## 示例
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
## 接口 ## 接口
Row(value:{space?: Length}) Row(value?:{space?: Length})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
...@@ -32,7 +32,7 @@ Row(value:{space?: Length}) ...@@ -32,7 +32,7 @@ Row(value:{space?: Length})
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| alignItems | [VerticalAlign](ts-appendix-enums.md#verticalalign) | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 | | alignItems | [VerticalAlign](ts-appendix-enums.md#verticalalign) | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 |
| justifyContent8+ | [FlexAlign](ts-appendix-enums.md#flexalign) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 | | justifyContent<sup>8+</sup> | [FlexAlign](ts-appendix-enums.md#flexalign) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 |
## 示例 ## 示例
......
...@@ -29,32 +29,41 @@ Scroll(scroller?: Scroller) ...@@ -29,32 +29,41 @@ Scroll(scroller?: Scroller)
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------------- | ---------------------------------------- | ------------------------ | --------- | | -------------- | ---------------------------------------- | ------------------------ | --------- |
| scrollable | ScrollDirection | ScrollDirection.Vertical | 设置滚动方法。 | | scrollable | ScrollDirection | ScrollDirection.Vertical | 设置滚动方法。 |
| scrollBar | [BarState](ts-appendix-enums.md#barstate) | ScrollDirection.Auto | 设置滚动条状态。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 |
| scrollBarColor | Color | - | 设置滚动条的颜色。 | | scrollBarColor | string&nbsp;\|&nbsp;number&nbsp;\|&nbsp;Color | - | 设置滚动条的颜色。 |
| scrollBarWidth | Length | - | 设置滚动条的宽度。 | | scrollBarWidth | Length | - | 设置滚动条的宽度。 |
| edgeEffect | EdgeEffect | EdgeEffect.Spring | 设置滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 |
- ScrollDirection枚举说明 ## ScrollDirection枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| ---------- | ---------- | | ---------- | ---------- |
| Horizontal | 仅支持水平方向滚动。 | | Horizontal | 仅支持水平方向滚动。 |
| Vertical | 仅支持竖直方向滚动。 | | Vertical | 仅支持竖直方向滚动。 |
| None | 不可滚动。 | | None | 不可滚动。 |
## EdgeEffect枚举说明
| 名称 | 描述 |
| ------ | ---------------------------------------- |
| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 |
| Fade | 阴影效果,滑动到边缘后会有圆弧状的阴影。 |
| None | 滑动到边缘后无效果。 |
## 事件 ## 事件
| 名称 | 功能描述 | | 名称 | 功能描述 |
| ---------------------------------------- | ----------------------------- | | ---------------------------------------- | ----------------------------- |
| onScrollBegin<sup>9+</sup>(dx: number, dy: number)&nbsp;=&gt;&nbsp;{ dxRemain: number, dyRemain: number } | 滚动开始事件回调。<br>参数:<br>- dx:即将发生的水平方向滚动量。<br>- dy:即将发生的竖向方向滚动量。<br>返回值:<br>- dxRemain:水平方向滚动剩余量。<br>- dyRemain:竖直方向滚动剩余量。 | | onScrollBegin<sup>9+</sup>(dx: number, dy: number)&nbsp;=&gt;&nbsp;{ dxRemain: number, dyRemain: number } | 滚动开始事件回调。<br>参数:<br>- dx:即将发生的水平方向滚动量。<br>- dy:即将发生的竖向方向滚动量。<br>返回值:<br>- dxRemain:水平方向滚动剩余量。<br>- dyRemain:竖直方向滚动剩余量。 |
| onScroll(xOffset:&nbsp;number,&nbsp;yOffset:&nbsp;number)&nbsp;=&gt;&nbsp;void | 滚动事件回调,&nbsp;返回滚动时水平、竖直方向偏移量。 | | onScroll(event: (xOffset: number, yOffset: number) => void) | 滚动事件回调,&nbsp;返回滚动时水平、竖直方向偏移量。 |
| onScrollEdge(side:&nbsp;Edge)&nbsp;=&gt;&nbsp;void | 滚动到边缘事件回调。 | | onScrollEdge(event: (side: Edge) => void) | 滚动到边缘事件回调。 |
| onScrollEnd()&nbsp;=&gt;&nbsp;void | 滚动停止事件回调。 | | onScrollEnd(event: () => void) | 滚动停止事件回调。 |
> **说明:** > **说明:**
> 若通过onScrollBegin事件和scrollBy方法实现容器嵌套滚动,需设置子滚动节点的EdgeEffect为None。如Scroll嵌套List滚动时,List组件的edgeEffect属性需设置为EdgeEffect.None。 > 若通过onScrollBegin事件和scrollBy方法实现容器嵌套滚动,需设置子滚动节点的EdgeEffect为None。如Scroll嵌套List滚动时,List组件的edgeEffect属性需设置为EdgeEffect.None。
## Scroller ## Scroller
可滚动容器组件的控制器,可以将此组件绑定至容器组件,然后通过它控制容器组件的滚动,目前支持绑定到List和Scroll组件上。 可滚动容器组件的控制器,可以将此组件绑定至容器组件,然后通过它控制容器组件的滚动,目前支持绑定到List、Scroll、ScrollBar上。
### 导入对象 ### 导入对象
...@@ -91,14 +100,8 @@ scrollEdge(value: Edge): void ...@@ -91,14 +100,8 @@ scrollEdge(value: Edge): void
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ----- | ---- | ---- | ---- | --------- | | ----- | ---- | ---- | ---- | --------- |
| value | Edge | 是 | - | 滚动到的边缘位置。 | | value | [Edge](ts-appendix-enums.md#edge) | 是 | - | 滚动到的边缘位置。 |
- Edge枚举说明
| 名称 | 值 | 描述 |
| ------ | ---- | ---------- |
| Top | 0 | 滑动到顶部 |
| Bottom | 2 | 滑动到底部 |
...@@ -112,7 +115,7 @@ scrollPage(value: { next: boolean, direction?: Axis }): void ...@@ -112,7 +115,7 @@ scrollPage(value: { next: boolean, direction?: Axis }): void
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| --------- | ------- | ---- | ---- | ------------------------------ | | --------- | ------- | ---- | ---- | ------------------------------ |
| next | boolean | 是 | - | 是否向下翻页。true表示向下翻页,false表示向上翻页。 | | next | boolean | 是 | - | 是否向下翻页。true表示向下翻页,false表示向上翻页。 |
| direction | Axis | 否 | - | 设置滚动方向为水平或竖直方向。 | | direction | [Axis](ts-appendix-enums.md#axis) | 否 | - | 设置滚动方向为水平或竖直方向。 |
### currentOffset ### currentOffset
......
...@@ -76,8 +76,8 @@ SideBarContainer( type?: SideBarContainerType ) ...@@ -76,8 +76,8 @@ SideBarContainer( type?: SideBarContainerType )
@Entry @Entry
@Component @Component
struct SideBarContainerExample { struct SideBarContainerExample {
normalIcon : Resource = $r("app.media.user") normalIcon : Resource = $r("app.media.icon")
selectedIcon: Resource = $r("app.media.userFull") selectedIcon: Resource = $r("app.media.icon")
@State arr: number[] = [1, 2, 3] @State arr: number[] = [1, 2, 3]
@State current: number = 1 @State current: number = 1
...@@ -100,18 +100,17 @@ struct SideBarContainerExample { ...@@ -100,18 +100,17 @@ struct SideBarContainerExample {
}.width('100%') }.width('100%')
.justifyContent(FlexAlign.SpaceEvenly) .justifyContent(FlexAlign.SpaceEvenly)
.backgroundColor('#19000000') .backgroundColor('#19000000')
RowSplit() {
Column(){
Text('Split page one').fontSize(30) Column() {
}.justifyContent(FlexAlign.Center) Text('SideBarContainer content text1').fontSize(25)
Column(){ Text('SideBarContainer content text2').fontSize(25)
Text('Split page two').fontSize(30) }
}.justifyContent(FlexAlign.Center) .margin({ top: 50, left: 20, right: 30 })
}.width('100%')
} }
.sideBarWidth(240) .sideBarWidth(150)
.minSideBarWidth(210) .minSideBarWidth(50)
.maxSideBarWidth(260) .maxSideBarWidth(300)
.onChange((value: boolean) => { .onChange((value: boolean) => {
console.info('status:' + value) console.info('status:' + value)
}) })
......
...@@ -46,10 +46,10 @@ Swiper(value:{controller?: SwiperController}) ...@@ -46,10 +46,10 @@ Swiper(value:{controller?: SwiperController})
| displayMode | SwiperDisplayMode | 主轴方向上元素排列的模式,优先以displayCount设置的个数显示,displayCount未设置时本属性生效。<br/>默认值:SwiperDisplayMode.Stretch | | displayMode | SwiperDisplayMode | 主轴方向上元素排列的模式,优先以displayCount设置的个数显示,displayCount未设置时本属性生效。<br/>默认值:SwiperDisplayMode.Stretch |
| cachedCount<sup>8+</sup> | number | 设置预加载子组件个数。<br/>默认值:1 | | cachedCount<sup>8+</sup> | number | 设置预加载子组件个数。<br/>默认值:1 |
| disableSwipe<sup>8+</sup> | boolean | 禁用组件滑动切换功能。<br/>默认值:false | | disableSwipe<sup>8+</sup> | boolean | 禁用组件滑动切换功能。<br/>默认值:false |
| curve<sup>8+</sup> | [Curve](ts-animatorproperty.md#Curve枚举说明) \| string | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-animatorproperty.md#Curve枚举说明),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。<br/>默认值:Curve.Ease | | curve<sup>8+</sup> | [Curve](ts-appendix-enums.md#curve) \| string | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-appendix-enums.md#curve),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。<br/>默认值:Curve.Ease |
| indicatorStyle<sup>8+</sup> | {<br/>left?:&nbsp;Length,<br/>top?:&nbsp;Length,<br/>right?:&nbsp;Length,<br/>bottom?:&nbsp;Length,<br/>size?:&nbsp;Length,<br/>color?:&nbsp;Color,<br/>selectedColor?:&nbsp;Color<br/>} | 设置indicator样式:<br/>-&nbsp;left:&nbsp;设置导航点距离Swiper组件左边的距离。<br/>-&nbsp;top:&nbsp;设置导航点距离Swiper组件顶部的距离。<br/>-&nbsp;right:&nbsp;设置导航点距离Swiper组件右边的距离。<br/>-&nbsp;bottom:&nbsp;设置导航点距离Swiper组件底部的距离。<br/>-&nbsp;size:&nbsp;设置导航点的直径<br/>-&nbsp;color:&nbsp;设置导航点的颜色。<br/>-&nbsp;selectedColor:&nbsp;设置选中的导航点的颜色。 | | indicatorStyle<sup>8+</sup> | {<br/>left?:&nbsp;Length,<br/>top?:&nbsp;Length,<br/>right?:&nbsp;Length,<br/>bottom?:&nbsp;Length,<br/>size?:&nbsp;Length,<br/>mask?:&nbsp;boolean,<br/>color?:&nbsp;[ResourceColor](../../ui/ts-types.md),<br/>selectedColor?:&nbsp;[ResourceColor](../../ui/ts-types.md)<br/>} | - | 设置indicator样式:<br/>-&nbsp;left:&nbsp;设置导航点距离Swiper组件左边的距离。<br/>-&nbsp;top:&nbsp;设置导航点距离Swiper组件顶部的距离。<br/>-&nbsp;right:&nbsp;设置导航点距离Swiper组件右边的距离。<br/>-&nbsp;bottom:&nbsp;设置导航点距离Swiper组件底部的距离。<br/>-&nbsp;size:&nbsp;设置导航点的直径。<br/>-&nbsp;mask:&nbsp;设置是否显示导航点蒙层样式<br/>-&nbsp;color:&nbsp;设置导航点的颜色。<br/>-&nbsp;selectedColor:&nbsp;设置选中的导航点的颜色。 |
| displayCount<sup>8+</sup> | number\|string | 设置元素显示个数。<br/>默认值:1 | | displayCount<sup>8+</sup> | number\|string | 设置元素显示个数。<br/>默认值:1 |
| effectMode<sup>8+</sup> | EdgeEffect | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。<br/>默认值:EdgeEffect.Spring | | effectMode<sup>8+</sup> | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。<br/>默认值:EdgeEffect.Spring |
## SwiperDisplayMode枚举说明 ## SwiperDisplayMode枚举说明
...@@ -98,9 +98,9 @@ finishAnimation(callback?: () => void): void ...@@ -98,9 +98,9 @@ finishAnimation(callback?: () => void): void
### onChange ### onChange
onChange(&nbsp;index:&nbsp;number)&nbsp;=&gt;&nbsp;void onChange(event: (index: number) => void)
当前显示的组件索引变化时触发该事件 当前显示的子组件索引变化时触发该事件,返回值为当前显示的子组件的索引值
**参数:** **参数:**
......
...@@ -28,7 +28,7 @@ TabContent() ...@@ -28,7 +28,7 @@ TabContent()
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| tabBar | string&nbsp;\|&nbsp;{<br/>icon?:&nbsp;string,<br/>text?:&nbsp;string<br/>}<br/>\|&nbsp;[CustomBuilder](../../ui/ts-types.md)<sup>8+</sup> | - | 设置TabBar上显示内容。<br/>CustomBuilder:&nbsp;构造器,内部可以传入组件(API8版本以上适用)。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;如果icon采用svg格式图源,则要求svg图源删除其自有宽高属性值。如采用带有自有宽高属性的svg图源,icon大小则是svg本身内置的宽高属性值大小。 | | tabBar | string&nbsp;\|&nbsp;Resource&nbsp;\|&nbsp;{<br/>icon?:&nbsp;string&nbsp;\|&nbsp;Resource,<br/>text?:&nbsp;string&nbsp;\|&nbsp;Resource<br/>}<br/>\|&nbsp;[CustomBuilder](../../ui/ts-types.md)<sup>8+</sup> | - | 设置TabBar上显示内容。<br/>CustomBuilder:&nbsp;构造器,内部可以传入组件(API8版本以上适用)。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;如果icon采用svg格式图源,则要求svg图源删除其自有宽高属性值。如采用带有自有宽高属性的svg图源,icon大小则是svg本身内置的宽高属性值大小。 |
> **说明:** > **说明:**
> - TabContent组件不支持设置通用宽度属性,其宽度默认撑满Tabs父组件。 > - TabContent组件不支持设置通用宽度属性,其宽度默认撑满Tabs父组件。
......
...@@ -41,11 +41,11 @@ Tabs(value: {barPosition?: BarPosition, index?: number, controller?: [TabsContro ...@@ -41,11 +41,11 @@ Tabs(value: {barPosition?: BarPosition, index?: number, controller?: [TabsContro
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| vertical | boolean | false | 是否为纵向Tab,默认为false。 | | vertical | boolean | false | 设置为false是为横向Tabs,设置为true时为纵向Tabs。 |
| scrollable | boolean | true | 是否可以通过左右滑动进行页面切换,默认为true。 | | scrollable | boolean | true | 设置为true时可以通过滑动页面进行页面切换,为false时不可滑动切换页面。 |
| barMode | BarMode | BarMode.Fixed | TabBar布局模式。 | | barMode | BarMode | BarMode.Fixed | TabBar布局模式,具体描述见BarMode枚举说明。 |
| barWidth | number | - | TabBar的宽度值,不设置时使用系统主题中的默认值。 | | barWidth | number&nbsp;\|&nbsp;string<sup>8+</sup> | - | TabBar的宽度值。 |
| barHeight | number | - | TabBar的高度值,不设置时使用系统主题中的默认值。 | | barHeight | number&nbsp;\|&nbsp;string<sup>8+</sup> | - | TabBar的高度值。 |
| animationDuration | number | 200 | TabContent滑动动画时长。 | | animationDuration | number | 200 | TabContent滑动动画时长。 |
- BarMode枚举说明 - BarMode枚举说明
......
...@@ -37,10 +37,16 @@ Line(options?: {width: Length, height: Length}) ...@@ -37,10 +37,16 @@ Line(options?: {width: Length, height: Length})
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| width | Length | 0 | 否 | 直线所在矩形的宽度。 | | width | [Length](../../ui/ts-types.md#length) | 0 | 否 | 直线所在矩形的宽度。 |
| height | Length | 0 | 否 | 直线所在矩形的高度。 | | height | [Length](../../ui/ts-types.md#length) | 0 | 否 | 直线所在矩形的高度。 |
| startPoint | Point | [0,&nbsp;0] | 是 | 直线起点坐标(相对坐标)。 | | startPoint | Array&lt;Point&gt; | [0,&nbsp;0] | 是 | 直线起点坐标(相对坐标)。 |
| endPoint | Point | [0,&nbsp;0] | 是 | 直线终点坐标(相对坐标)。 | | endPoint | Array&lt;Point&gt; | [0,&nbsp;0] | 是 | 直线终点坐标(相对坐标)。 |
## Point
| 名称 | 类型定义 | 描述 |
| ----- | --------------------- | ---------------------------------------------------- |
| Point | [[Length](../../ui/ts-types.md#length),&nbsp;[Length](ts-types.md#length)] | 用于描述点坐标,第一个值为x轴坐标,第二个值为y坐标。 |
## 示例 ## 示例
......
...@@ -16,7 +16,7 @@ show(options?: DatePickerDialogOptions) ...@@ -16,7 +16,7 @@ show(options?: DatePickerDialogOptions)
定义日期滑动选择器弹窗并弹出。 定义日期滑动选择器弹窗并弹出。
- options参数 - DatePickerDialogOptions参数说明
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| start | Date | 否 | Date('1970-1-1') | 指定选择器的起始日期。 | | start | Date | 否 | Date('1970-1-1') | 指定选择器的起始日期。 |
......
...@@ -20,7 +20,7 @@ show(options: TextPickerDialogOptions) ...@@ -20,7 +20,7 @@ show(options: TextPickerDialogOptions)
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| range | string[] | 是 | - | 选择器的数据选择范围。 | | range | string[] | 是 | - | 选择器的数据选择范围。 |
| selected | number | 否 | 第一个元素 | 选中项在数组中的index值。 | | selected | number | 否 | 0 | 选中项在数组中的index值。 |
| value | string | 否 | - | 选中项文本值。当设置了selected参数时,该值不生效。如果该值不在range范围内,则默认取range第一个元素。| | value | string | 否 | - | 选中项文本值。当设置了selected参数时,该值不生效。如果该值不在range范围内,则默认取range第一个元素。|
| defaultPickerItemHeight | number | 否 | - | 默认Picker内容项元素高度。 | | defaultPickerItemHeight | number | 否 | - | 默认Picker内容项元素高度。 |
| onAccept | (value: TextPickerResult) => void | 否 | - | 点击弹窗中确定按钮时触发。 | | onAccept | (value: TextPickerResult) => void | 否 | - | 点击弹窗中确定按钮时触发。 |
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
@Entry @Entry
@Component @Component
struct TransitionExample { struct TransitionExample {
@State btn1: boolean = false @State btn: boolean = false
@State show: string = "show" @State show: string = "show"
build() { build() {
...@@ -40,15 +40,15 @@ struct TransitionExample { ...@@ -40,15 +40,15 @@ struct TransitionExample {
Button(this.show).width(80).height(30).backgroundColor(0x317aff).margin({bottom:50}) Button(this.show).width(80).height(30).backgroundColor(0x317aff).margin({bottom:50})
.onClick(() => { .onClick(() => {
animateTo({ duration: 1000 }, () => { animateTo({ duration: 1000 }, () => {
this.btn1 = !this.btn1 this.btn = !this.btn
if(this.btn1){ if(this.btn){
this.show = "hide" this.show = "hide"
}else{ }else{
this.show = "show" this.show = "show"
} }
}) })
}) })
if (this.btn1) { if (this.btn) {
// 插入和删除配置为不同的过渡效果 // 插入和删除配置为不同的过渡效果
Button() { Button() {
Image($r('app.media.bg1')).width("80%").height(300) Image($r('app.media.bg1')).width("80%").height(300)
......
...@@ -49,7 +49,7 @@ struct SizeExample { ...@@ -49,7 +49,7 @@ struct SizeExample {
Text('layoutWeight(1)') Text('layoutWeight(1)')
.size({ width: '30%', height: 110 }).backgroundColor(0xFFEFD5).textAlign(TextAlign.Center) .size({ width: '30%', height: 110 }).backgroundColor(0xFFEFD5).textAlign(TextAlign.Center)
.layoutWeight(1) .layoutWeight(1)
// 权重0 // 权重2
Text('layoutWeight(2)') Text('layoutWeight(2)')
.size({ width: '30%', height: 110 }).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) .size({ width: '30%', height: 110 }).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
.layoutWeight(2) .layoutWeight(2)
......
...@@ -30,21 +30,8 @@ ...@@ -30,21 +30,8 @@
## EventTarget<sup>8+</sup>对象说明 ## EventTarget<sup>8+</sup>对象说明
| 名称 | 参数类型 | 描述 | | 名称 | 参数类型 | 描述 |
| ---- | ----------------- | ---------- | | ---- | ----------------- | ---------- |
| area | [Area](#area8对象说明) | 目标元素的区域信息。 | | area | [Area](../../ui/ts-types.md#area8) | 目标元素的区域信息。 |
## Area<sup>8+</sup>对象说明
| 属性名称 | 类型 | 描述 |
| -------------- | -------------------------- | ------------------- |
| width | number | 目标元素的宽度,单位为vp。 |
| height | number | 目标元素的高度,单位为vp。 |
| position | Position | 目标元素左上角相对父元素左上角的位置。 |
| globalPosition | Position | 目标元素左上角相对页面左上角的位置。 |
## Position<sup>8+</sup>对象说明
| 属性名称 | 参数类型 | 描述 |
| ---- | ------ | ----------- |
| x | number | x轴坐标,单位为vp。 |
| y | number | y轴坐标,单位为vp。 |
## 示例 ## 示例
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
"when":"always" "when":"always"
} }
} }
], ]
} }
} }
``` ```
......
...@@ -138,3 +138,4 @@ ...@@ -138,3 +138,4 @@
| ohos.permission.WRITE_IMAGEVIDEO | system_basic | user_grant | TRUE | 允许修改用户公共目录的图片或视频文件。 | | ohos.permission.WRITE_IMAGEVIDEO | system_basic | user_grant | TRUE | 允许修改用户公共目录的图片或视频文件。 |
| ohos.permission.WRITE_AUDIO | system_basic | user_grant | TRUE | 允许修改用户公共目录的音频文件。 | | ohos.permission.WRITE_AUDIO | system_basic | user_grant | TRUE | 允许修改用户公共目录的音频文件。 |
| ohos.permission.WRITE_DOCUMENT | system_basic | user_grant | TRUE | 允许修改用户公共目录的文档。 | | ohos.permission.WRITE_DOCUMENT | system_basic | user_grant | TRUE | 允许修改用户公共目录的文档。 |
| ohos.permission.ABILITY_BACKGROUND_COMMUNICATION | system_basic | system_grant | TRUE | 允许应用将Ability组件在后台启动并与该Ability建立通信连接。 |
\ No newline at end of file
...@@ -47,7 +47,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -47,7 +47,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
3. 安装[git客户端](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading)并配置用户信息。 3. 安装[git客户端](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading)并配置用户信息。
``` ```shell
git config --global user.name "yourname" git config --global user.name "yourname"
git config --global user.email "your-email-address" git config --global user.email "your-email-address"
git config --global credential.helper store git config --global credential.helper store
...@@ -57,7 +57,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -57,7 +57,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
下述命令中的安装路径以"~/bin"为例,请用户自行创建所需目录。 下述命令中的安装路径以"~/bin"为例,请用户自行创建所需目录。
``` ```shell
mkdir ~/bin mkdir ~/bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo
chmod a+x ~/bin/repo chmod a+x ~/bin/repo
...@@ -66,7 +66,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -66,7 +66,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
5. 将repo添加到环境变量。 5. 将repo添加到环境变量。
``` ```shell
vim ~/.bashrc # 编辑环境变量 vim ~/.bashrc # 编辑环境变量
export PATH=~/bin:$PATH # 在环境变量的最后添加一行repo路径信息 export PATH=~/bin:$PATH # 在环境变量的最后添加一行repo路径信息
source ~/.bashrc # 应用环境变量 source ~/.bashrc # 应用环境变量
...@@ -83,7 +83,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -83,7 +83,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
方式一(推荐):通过repo + ssh下载(需注册公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191))。 方式一(推荐):通过repo + ssh下载(需注册公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191))。
``` ```shell
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c repo sync -c
repo forall -c 'git lfs pull' repo forall -c 'git lfs pull'
...@@ -92,7 +92,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -92,7 +92,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
方式二:通过repo + https下载。 方式二:通过repo + https下载。
``` ```shell
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c repo sync -c
repo forall -c 'git lfs pull' repo forall -c 'git lfs pull'
...@@ -116,26 +116,28 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -116,26 +116,28 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
先要在本地安装Node.js和hpm命令行工具,安装步骤如下: 先要在本地安装Node.js和hpm命令行工具,安装步骤如下:
1. 安装Node.js。 1. 安装Node.js。
官网下载并在本地安装Node.js.
官网下载并在本地安装Node.js。
[Node.js](https://nodejs.org/)版本需不低于12.x (包含npm 6.14.4),推荐安装LTS版本。 [Node.js](https://nodejs.org/)版本需不低于12.x (包含npm 6.14.4),推荐安装LTS版本。
2. 通过Node.js自带的npm安装hpm命令行工具。 2. 通过Node.js自带的npm安装hpm命令行工具。
打开CMD,执行以下命令: 打开CMD,执行以下命令:
``` ```shell
npm install -g @ohos/hpm-cli npm install -g @ohos/hpm-cli
``` ```
3. 安装完成后执行如下命令,显示hpm版本,即安装成功。 3. 安装完成后执行如下命令,显示hpm版本,即安装成功。
``` ```shell
hpm -V 或 hpm --version hpm -V 或 hpm --version
``` ```
4. 如果升级hpm的版本,请执行如下命令: 4. 如果升级hpm的版本,请执行如下命令:
``` ```shell
npm update -g @ohos/hpm-cli npm update -g @ohos/hpm-cli
``` ```
...@@ -210,10 +212,10 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及 ...@@ -210,10 +212,10 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**<br> > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**<br>
> 镜像仓库每日23:00(UTC +8:00)同步。 > 镜像仓库每日23:00(UTC +8:00)同步。
方式一(推荐):通过repo + ssh下载(需注册公钥,请参考[GitHub帮助中心](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account))。
方式一(推荐):通过repo + ssh下载(需注册公钥,请参考[GitHub帮助中心](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account))。
``` ```shell
repo init -u git@github.com:openharmony/manifest.git -b master --no-repo-verify repo init -u git@github.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c repo sync -c
repo forall -c 'git lfs pull' repo forall -c 'git lfs pull'
...@@ -222,7 +224,7 @@ repo forall -c 'git lfs pull' ...@@ -222,7 +224,7 @@ repo forall -c 'git lfs pull'
方式二:通过repo + https下载。 方式二:通过repo + https下载。
``` ```shell
repo init -u https://github.com/openharmony/manifest.git -b master --no-repo-verify repo init -u https://github.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c repo sync -c
repo forall -c 'git lfs pull' repo forall -c 'git lfs pull'
......
...@@ -30,15 +30,15 @@ OpenHarmony支持如下几种系统类型: ...@@ -30,15 +30,15 @@ OpenHarmony支持如下几种系统类型:
- 轻量系统(mini system) - 轻量系统(mini system)
面向MCU类处理器例如Arm Cortex-M、RISC-V 32位的设备,硬件资源极其有限,支持的设备最小内存为128KiB,可以提供多种轻量级网络协议,轻量级的图形框架,以及丰富的IOT总线读写部件等。可支撑的产品如智能家居领域的连接类模组、传感器设备、穿戴类设备等。 面向MCU类处理器例如Arm Cortex-M、RISC-V 32位的设备,硬件资源极其有限,支持的设备最小内存为128KiB,可以提供多种轻量级网络协议,轻量级的图形框架,以及丰富的IOT总线读写部件等。可支撑的产品如智能家居领域的连接类模组、传感器设备、穿戴类设备等。典型的开发板型号是Multi-modalV200Z-R。
- 小型系统(small system) - 小型系统(small system)
面向应用处理器例如Arm Cortex-A的设备,支持的设备最小内存为1MiB,可以提供更高的安全能力、标准的图形框架、视频编解码的多媒体能力。可支撑的产品如智能家居领域的IP Camera、电子猫眼、路由器以及智慧出行域的行车记录仪等。 面向应用处理器例如Arm Cortex-A的设备,支持的设备最小内存为1MiB,可以提供更高的安全能力、标准的图形框架、视频编解码的多媒体能力。可支撑的产品如智能家居领域的IP Camera、电子猫眼、路由器以及智慧出行域的行车记录仪等。典型的开发板型号是Hispark_Taurus。
- 标准系统(standard system) - 标准系统(standard system)
面向应用处理器例如Arm Cortex-A的设备,支持的设备最小内存为128MiB,可以提供增强的交互能力、3D GPU以及硬件合成能力、更多控件以及动效更丰富的图形能力、完整的应用框架。可支撑的产品如高端的冰箱显示屏。 面向应用处理器例如Arm Cortex-A的设备,支持的设备最小内存为128MiB,可以提供增强的交互能力、3D GPU以及硬件合成能力、更多控件以及动效更丰富的图形能力、完整的应用框架。可支撑的产品如高端的冰箱显示屏。典型的开发板型号是润和DAYU200。
## 目录<a name="section161941989596"></a> ## 目录<a name="section161941989596"></a>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册