提交 3c06fdef 编写于 作者: Z zengyawen

update docs

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 5672e5fc
...@@ -22,10 +22,10 @@ font-face用于定义字体样式。应用可以在style中定义font-face来指 ...@@ -22,10 +22,10 @@ font-face用于定义字体样式。应用可以在style中定义font-face来指
src: url('/common/HWfont.ttf'); src: url('/common/HWfont.ttf');
} }
``` ```
**font-family:** 自定义字体的名称。
**font-family:**自定义字体的名称。 **src:** 自定义字体的来源,支持如下类别。
**src:**自定义字体的来源,支持如下类别。
- 项目中的字体文件:通过url指定项目中的字体文件路径(只支持绝对路径,详见[文件组织](js-service-widget-file.md))。 - 项目中的字体文件:通过url指定项目中的字体文件路径(只支持绝对路径,详见[文件组织](js-service-widget-file.md))。
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
### 过渡方向 ### 过渡方向
通过direction或者angle指定过渡方向。 通过direction或者angle指定过渡方向。
- direction:进行方向渐变。 - direction:进行方向渐变。
- angle:进行角度渐变。 - angle:进行角度渐变。
...@@ -33,27 +34,27 @@ background: repeating-linear-gradient(direction/angle, color, color, ...); ...@@ -33,27 +34,27 @@ background: repeating-linear-gradient(direction/angle, color, color, ...);
支持以下四种方式:\#ff0000、\#ffff0000、rgb(255, 0, 0)、rgba(255, 0, 0, 1),需要指定至少两种颜色。 支持以下四种方式:\#ff0000、\#ffff0000、rgb(255, 0, 0)、rgba(255, 0, 0, 1),需要指定至少两种颜色。
- 参数 - 参数
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| direction | to&nbsp;&lt;side-or-corner&gt;&nbsp;&nbsp;&lt;side-or-corner&gt;&nbsp;=&nbsp;[left&nbsp;\|&nbsp;right]&nbsp;\|\|&nbsp;[top&nbsp;\|&nbsp;bottom] | to&nbsp;bottom&nbsp;(由上到下渐变) | 否 | 指定过渡方向,如:to&nbsp;left&nbsp;(从右向左渐变)&nbsp;&nbsp;,或者to&nbsp;bottom&nbsp;right&nbsp;(从左上角到右下角)。 | | direction | to&nbsp;&lt;side-or-corner&gt;&nbsp;&nbsp;&lt;side-or-corner&gt;&nbsp;=&nbsp;[left&nbsp;\|&nbsp;right]&nbsp;\|\|&nbsp;[top&nbsp;\|&nbsp;bottom] | to&nbsp;bottom&nbsp;(由上到下渐变) | 否 | 指定过渡方向,如:to&nbsp;left&nbsp;(从右向左渐变)&nbsp;&nbsp;,或者to&nbsp;bottom&nbsp;right&nbsp;(从左上角到右下角)。 |
| angle | &lt;deg&gt; | 180deg | 否 | 指定过渡方向,以元素几何中心为坐标原点,水平方向为X轴,angle指定了渐变线与Y轴的夹角(顺时针方向)。 | | angle | &lt;deg&gt; | 180deg | 否 | 指定过渡方向,以元素几何中心为坐标原点,水平方向为X轴,angle指定了渐变线与Y轴的夹角(顺时针方向)。 |
| color | &lt;color&gt;&nbsp;[&lt;length&gt;\|&lt;percentage&gt;] | - | 是 | 定义使用渐变样式区域内颜色的渐变效果。 | | color | &lt;color&gt;&nbsp;[&lt;length&gt;\|&lt;percentage&gt;] | - | 是 | 定义使用渐变样式区域内颜色的渐变效果。 |
- 示例 - 示例
1. 默认渐变方向为从上向下渐变。 1. 默认渐变方向为从上向下渐变。
```css ```css
#gradient { #gradient {
height: 300px; height: 300px;
width: 600px; width: 600px;
/* 从顶部开始向底部由红色向绿色渐变 */ /* 从顶部开始向底部由红色向绿色渐变 */
background: linear-gradient(red, #00ff00); background: linear-gradient(red, #00ff00);
} }
``` ```
![111](figures/111.PNG) ![111](figures/111.PNG)
2. 45度夹角渐变。 2. 45度夹角渐变。
...@@ -63,7 +64,7 @@ background: repeating-linear-gradient(direction/angle, color, color, ...); ...@@ -63,7 +64,7 @@ background: repeating-linear-gradient(direction/angle, color, color, ...);
background: linear-gradient(45deg, rgb(255,0,0),rgb(0, 255, 0)); background: linear-gradient(45deg, rgb(255,0,0),rgb(0, 255, 0));
``` ```
![222](figures/222.PNG) ![222](figures/222.PNG)
3. 设置方向从左向右渐变。 3. 设置方向从左向右渐变。
...@@ -73,7 +74,7 @@ background: repeating-linear-gradient(direction/angle, color, color, ...); ...@@ -73,7 +74,7 @@ background: repeating-linear-gradient(direction/angle, color, color, ...);
``` ```
![333](figures/333.PNG) ![333](figures/333.PNG)
4. 重复渐变。 4. 重复渐变。
...@@ -81,4 +82,4 @@ background: repeating-linear-gradient(direction/angle, color, color, ...); ...@@ -81,4 +82,4 @@ background: repeating-linear-gradient(direction/angle, color, color, ...);
/* 从左向右重复渐变,重复渐变区域30px(60-30)透明度0.5 */ /* 从左向右重复渐变,重复渐变区域30px(60-30)透明度0.5 */
background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30px,rgba(0, 0, 255, .5) 60px); background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30px,rgba(0, 0, 255, .5) 60px);
``` ```
![444](figures/444.PNG) ![444](figures/444.PNG)
...@@ -46,7 +46,7 @@ window用于定义与显示窗口相关的配置。对于卡片尺寸适配问 ...@@ -46,7 +46,7 @@ window用于定义与显示窗口相关的配置。对于卡片尺寸适配问
> >
> - autoDesignWidth、designWidth的设置不影响默认值计算方式和绘制结果。 > - autoDesignWidth、designWidth的设置不影响默认值计算方式和绘制结果。
| 属性 | 类型 | 必填 | 默认值 | 描述 | | 属性 | 类型 | 必填 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| designWidth | number | 否 | 150px | 页面显示设计时的参考值,实际显示效果基于设备宽度与参考值之间的比例进行缩放。 | | designWidth | number | 否 | 150px | 页面显示设计时的参考值,实际显示效果基于设备宽度与参考值之间的比例进行缩放。 |
| autoDesignWidth | boolean | 否 | false | 页面设计基准宽度是否自动计算,当设为true时,designWidth将会被忽略,设计基准宽度由设备宽度与屏幕密度计算得出。 | | autoDesignWidth | boolean | 否 | false | 页面设计基准宽度是否自动计算,当设为true时,designWidth将会被忽略,设计基准宽度由设备宽度与屏幕密度计算得出。 |
......
...@@ -75,7 +75,7 @@ HML(OpenHarmony Markup Language)是一套类HTML的标记语言,通过组 ...@@ -75,7 +75,7 @@ HML(OpenHarmony Markup Language)是一套类HTML的标记语言,通过组
| 选择器 | 样例 | 默认值 | 样例描述 | | 选择器 | 样例 | 默认值 | 样例描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| action | string | "router" | 事件类型。<br/>- "router":用于应用跳转。<br/>- "message":自定义点击事件。 | | action | string | "router" | 事件类型。<br/>- "router":用于应用跳转。<br/>- "message":自定义点击事件。 |
| abilityName | string | - | 跳转ability名。 | | abilityName | string | - | 跳转ability名。 |
| params | Object | - | 跳转应用携带的额外参数。 | | params | Object | - | 跳转应用携带的额外参数。 |
...@@ -145,7 +145,8 @@ HML(OpenHarmony Markup Language)是一套类HTML的标记语言,通过组 ...@@ -145,7 +145,8 @@ HML(OpenHarmony Markup Language)是一套类HTML的标记语言,通过组
在API Version 8,want参数需要在app.js或app.ets文件的onCreate方法中调用[featureAbility.getWant](../apis/js-apis-featureAbility.md#featureabilitygetwant-1)接口接收相关参数。 在API Version 8,want参数需要在app.js或app.ets文件的onCreate方法中调用[featureAbility.getWant](../apis/js-apis-featureAbility.md#featureabilitygetwant-1)接口接收相关参数。
- 消息事件格式 - 消息事件格式
| 选择器 | 样例 | 默认值 | 样例描述 |
| 选择器 | 样例 | 默认值 | 样例描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| action | string | message | 表示事件类型。 | | action | string | message | 表示事件类型。 |
| params | Object | - | 跳转应用携带的额外参数。 | | params | Object | - | 跳转应用携带的额外参数。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册