提交 765f06cd 编写于 作者: E ester.zhou

Update docs (19423)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 2e81e769
......@@ -8,7 +8,7 @@
| Name | Type | Readable| Writable| Description |
| ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ |
| events | Array\<string> | Yes | No | Name of the common event to publish. |
| events | Array\<string> | Yes | No | Common events to subscribe to. |
| publisherPermission | string | Yes | No | Permissions required for publishers to publish the common event. |
| publisherDeviceId | string | Yes | No | Device ID. The value must be the ID of a device on the same network. |
| userId | number | Yes | No | User ID. The value must be an existing user ID in the system. If this parameter is not specified, the default value, which is the ID of the current user, will be used. |
......
......@@ -30,13 +30,13 @@ Obtains the value of the system parameter with the specified key.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | string | Yes| Key of the system parameter.|
| def | string | No| Default value of the system parameter.<br> It works only when the system parameter does not exist.<br>The value can be **undefined** (in which case an empty string will be returned) or any custom value.|
| def | string | No| Default value of the system parameter.<br>It works only when the system parameter does not exist.<br>The value can be **undefined** or any custom value. |
**Return value**
| Type| Description|
| -------- | -------- |
| string | Value of the system parameter. If the specified key does not exist, the default value is returned. If no default value has been set, an empty string will be returned.|
| string | Value of the system parameter.<br>If the specified key exists, the set value is returned.<br>If the specified key does not exist and **def** is set to a valid value, the set value is returned. If the specified key does not exist and **def** is set to an invalid value (such as **undefined**) or is not set, an empty string is returned. |
**Example**
......@@ -44,7 +44,7 @@ Obtains the value of the system parameter with the specified key.
try {
var info = systemparameter.getSync("const.ohos.apiversion");
console.log(JSON.stringify(info));
}catch(e){
} catch(e) {
console.log("getSync unexpected error: " + e);
}
```
......@@ -74,7 +74,7 @@ try {
} else {
console.log(" get test.parameter.key value err:" + err.code)
}});
}catch(e){
} catch(e) {
console.log("get unexpected error: " + e);
}
```
......@@ -106,7 +106,7 @@ try {
console.log(" get test.parameter.key value err:" + err.code)
}
});
}catch(e){
} catch(e) {
console.log("get unexpected error:" + e)
}
```
......@@ -124,7 +124,7 @@ Obtains the value of the system parameter with the specified key. This API uses
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | string | Yes| Key of the system parameter.|
| def | string | No| Default value of the system parameter.<br> It works only when the system parameter does not exist.<br>The value can be **undefined** (in which case an empty string will be returned) or any custom value.|
| def | string | No| Default value of the system parameter.<br>It works only when the system parameter does not exist.<br>The value can be **undefined** or any custom value. |
**Return value**
......@@ -142,7 +142,7 @@ try {
}).catch(function (err) {
console.log("get test.parameter.key error: " + err.code);
});
}catch(e){
} catch(e) {
console.log("get unexpected error: " + e);
}
```
......@@ -172,7 +172,7 @@ Sets a value for the system parameter with the specified key.
```ts
try {
systemparameter.setSync("test.parameter.key", "default");
}catch(e){
} catch(e) {
console.log("set unexpected error: " + e);
}
```
......@@ -207,7 +207,7 @@ try {
} else {
console.log("set test.parameter.key value err:" + err.code)
}});
}catch(e){
} catch(e) {
console.log("set unexpected error: " + e);
}
```
......@@ -247,7 +247,7 @@ try {
}).catch(function (err) {
console.log(" set test.parameter.key error: " + err.code);
});
}catch(e){
} catch(e) {
console.log("set unexpected error: " + e);
}
```
......@@ -29,13 +29,13 @@ Obtains the value of the system parameter with the specified key.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | string | Yes| Key of the system parameter.|
| def | string | No| Default value of the system parameter.<br> It works only when the system parameter does not exist.<br>The value can be **undefined** (in which case an empty string will be returned) or any custom value.|
| def | string | No| Default value of the system parameter.<br>It works only when the system parameter does not exist.<br>The value can be **undefined** or any custom value. |
**Return value**
| Type| Description|
| -------- | -------- |
| string | Value of the system parameter. If the specified key does not exist, the default value is returned. If no default value has been set, an empty string will be returned.|
| string | Value of the system parameter.<br>If the specified key exists, the set value is returned.<br>If the specified key does not exist and **def** is set to a valid value, the set value is returned. If the specified key does not exist and **def** is set to an invalid value (such as **undefined**) or is not set, an exception is thrown. |
**Example**
......@@ -43,7 +43,7 @@ Obtains the value of the system parameter with the specified key.
try {
var info = systemparameter.getSync("const.ohos.apiversion");
console.log(JSON.stringify(info));
}catch(e){
} catch(e) {
console.log("getSync unexpected error: " + e);
}
```
......@@ -73,7 +73,7 @@ try {
} else {
console.log(" get test.parameter.key value err:" + err.code)
}});
}catch(e){
} catch(e) {
console.log("get unexpected error: " + e);
}
```
......@@ -105,7 +105,7 @@ try {
console.log(" get test.parameter.key value err:" + err.code)
}
});
}catch(e){
} catch(e) {
console.log("get unexpected error:" + e)
}
```
......@@ -123,7 +123,7 @@ Obtains the value of the system parameter with the specified key. This API uses
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | string | Yes| Key of the system parameter.|
| def | string | No| Default value of the system parameter.<br> It works only when the system parameter does not exist.<br>The value can be **undefined** (in which case an empty string will be returned) or any custom value.|
| def | string | No| Default value of the system parameter.<br>It works only when the system parameter does not exist.<br>The value can be **undefined** or any custom value. |
**Return value**
......@@ -141,7 +141,7 @@ try {
}).catch(function (err) {
console.log("get test.parameter.key error: " + err.code);
});
}catch(e){
} catch(e) {
console.log("get unexpected error: " + e);
}
```
......@@ -166,7 +166,7 @@ Sets a value for the system parameter with the specified key.
```ts
try {
systemparameter.setSync("test.parameter.key", "default");
}catch(e){
} catch(e) {
console.log("set unexpected error: " + e);
}
```
......@@ -197,7 +197,7 @@ try {
} else {
console.log("set test.parameter.key value err:" + err.code)
}});
}catch(e){
} catch(e) {
console.log("set unexpected error: " + e);
}
```
......@@ -233,7 +233,7 @@ try {
}).catch(function (err) {
console.log(" set test.parameter.key error: " + err.code);
});
}catch(e){
} catch(e) {
console.log("set unexpected error: " + e);
}
```
......@@ -14,7 +14,7 @@ You can set the background for a component.
| backgroundImage | src: [ResourceStr](ts-types.md#resourcestr),<br>repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | **src**: image address, which can be the address of an Internet or a local image or a Base64 encoded image. SVG images are not supported.<br>**repeat**: whether the background image is repeated. By default, the background image is not repeated. If the set image has a transparent background and **backgroundColor** is set, the image is overlaid on the background color.<br>Since API version 9, this API is supported in ArkTS widgets.|
| backgroundImageSize | {<br>width?: [Length](ts-types.md#length),<br>height?: [Length](ts-types.md#length)<br>} \| [ImageSize](ts-appendix-enums.md#imagesize) | Width and height of the background image. If the input is a **{width: Length, height: Length}** object and only one attribute is set, the other attribute is the set value multiplied by the original aspect ratio of the image. By default, the original image aspect ratio remains unchanged.<br>The value range of **width** and **height** is [0, +∞).<br>Default value: **ImageSize.Auto**<br>Since API version 9, this API is supported in ArkTS widgets.<br>**NOTE**<br>A value less than 0 evaluates to the value **0**. If **height** is set but **width** is not, the image width is adjusted based on the original aspect ratio of the image.|
| backgroundImagePosition | [Position](ts-types.md#position8) \| [Alignment](ts-appendix-enums.md#alignment) | Position of the background image in the component, that is, the coordinates relative to the upper left corner of the component.<br>Default value:<br>{<br>x: 0,<br>y: 0<br>} <br> When **x** and **y** are set in percentage, the offset is calculated based on the width and height of the component.<br>Since API version 9, this API is supported in ArkTS widgets.|
| backgroundBlurStyle<sup>9+</sup> | value:[BlurStyle](ts-appendix-enums.md#blurstyle9),<br>options<sup>10+</sup>?:[BackgroundBlurStyleOptions](#backgroundblurstyleoptions10) | Background blur style applied between the content and the background.<br>**value**: settings of the background blur style, including the blur radius, mask color, mask opacity, and saturation.<br>**options**: background blur options. Optional.<br>This API is supported in ArkTS widgets.|
| backgroundBlurStyle<sup>9+</sup> | value:[BlurStyle](ts-appendix-enums.md#blurstyle9),<br>options<sup>10+</sup>?:[BackgroundBlurStyleOptions](#backgroundblurstyleoptions10) | Background blur style applied between the content and the background.<br>**value**: settings of the background blur style, including the blur radius, mask color, mask opacity, saturation, and brightness.<br>**options**: background blur options. Optional.<br>This API is supported in ArkTS widgets.|
## BackgroundBlurStyleOptions<sup>10+</sup>
......@@ -22,6 +22,7 @@ You can set the background for a component.
| --------------------------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| colorMode<sup>10+</sup> | [ThemeColorMode](ts-appendix-enums.md#themecolormode10) | No | Color mode used for the background blur.<br>Default value: **ThemeColorMode.System**|
| adaptiveColor<sup>10+</sup> | [AdaptiveColor](ts-appendix-enums.md#adaptivecolor10) | No | Adaptive color mode.<br>Default value: **AdaptiveColor.Default**|
| scale<sup>10+</sup> | number | No | Blurredness of the background material. This API is a system API.<br>Default value: **1.0**<br>Value range: [0.0, 1.0]<br>|
## Example
......@@ -109,7 +110,7 @@ struct BackgroundBlurStyleDemo {
}
.width('50%')
.height('50%')
.backgroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT })
.backgroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
.position({ x: '15%', y: '30%' })
}
.height('100%')
......
......@@ -9,16 +9,16 @@ You can set the click effect for a component to define how it behaves when click
### Attributes
| Name | Type | Description |
| ----------- | ------------------- | ------------------------------------------------------------ |
| clickEffect | [ClickEffect](#clickeffect) \| null | Click effect of the component.<br>**NOTE**<br>The click effect is revoked when this attribute is set to **null**.|
| Name | Type | Description |
| ----------- | ------------------------------------------- | ------------------------------------------------------------ |
| clickEffect | [ClickEffect](#clickeffect) \| null | Click effect of the component.<br>**NOTE**<br>You can remove the click effect by setting this attribute to **undefined** or **null**.<br>Avoid using this attribute in scenarios where the component size dynamically changes.<br>This attribute is not supported when the component cannot trigger a universal event.|
### ClickEffect
| Name | Type | Mandatory| Description |
| ----- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| level | [ClickEffectLevel](ts-appendix-enums.md#clickeffectlevel10) | Yes | Click effect of the component.<br>Default value: **ClickEffectLevel.LIGHT**|
| scale | number | No | Zoom ratio. This parameter works based on the setting of **ClickEffectLevel**.<br>**NOTE**<br>The default value of this parameter varies by the value of **level**.<br>- If **level** is set to **ClickEffectLevel.LIGHT**, the default value is **0.90**.<br>- If **level** is set to **ClickEffectLevel.MIDDLE** or **ClickEffectLevel.HEAVY**, the default value is **0.95**. |
| level | [ClickEffectLevel](ts-appendix-enums.md#clickeffectlevel10) | Yes | Click effect of the component.<br>**NOTE**<br>If **level** is set to **undefined** or **null**, the click effect corresponding to **ClickEffectLevel.LIGHT** will be used. For details about the zoom ratio, see the description of **scale**.|
| scale | number | No | Zoom ratio. This parameter works based on the setting of **ClickEffectLevel**.<br>**NOTE**<br>The default value of this parameter varies by the value of **level**.<br>- If **level** is set to **ClickEffectLevel.LIGHT**, the default value is **0.90**.<br>- If **level** is set to **ClickEffectLevel.MIDDLE** or **ClickEffectLevel.HEAVY**, the default value is **0.95**.<br>- If **level** is set to **undefined** or **null** (both of which evaluate to **ClickEffectLevel.LIGHT**), the default value is **0.90**.<br>If **scale** is set to **undefined** or **null**, the default zoom ratio for the set level will be used. |
### Example
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册