未验证 提交 961965ba 编写于 作者: L LiAn 提交者: Gitee

update zh-cn/application-dev/reference/arkui-js/js-components-svg-text.md.

Signed-off-by: NLiAn <lian15@huawei.com>
上级 e5e40940
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
文本,用于呈现一段信息。 文本,用于呈现一段信息。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > **说明:**
> - 该组件从API version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > - 该组件从API version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> >
> - 文本的展示内容需要写在元素标签内,可嵌套tspan子元素标签分段,可嵌套textPath子元素标签按指定路径绘制。 > - 文本的展示内容需要写在元素标签内,可嵌套tspan子元素标签分段,可嵌套textPath子元素标签按指定路径绘制。
> >
> - 只支持被父元素标签svg嵌套。 > - 只支持被父元素标签svg嵌套。
> >
> - 只支持默认字体sans-serif。 > - 只支持默认字体sans-serif。
## 权限列表 ## 权限列表
...@@ -26,26 +26,26 @@ ...@@ -26,26 +26,26 @@
支持以下表格中的属性。 支持以下表格中的属性。
| 名称 | 类型 | 默认值 | 必填 | 描述 | | 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- | | -------------- | ---------------------------------- | ----- | ---- | ---------------------------------------- |
| id | string | - | 否 | 组件的唯一标识。 | | id | string | - | 否 | 组件的唯一标识。 |
| x | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置组件左上角x轴坐标 | | x | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置组件左上角x轴坐标 |
| y | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置组件左上角y轴坐标 | | y | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置组件左上角y轴坐标 |
| dx | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置文本x轴偏移 | | dx | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置文本x轴偏移 |
| dy | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置文本y轴偏移 | | dy | &lt;length&gt;\|&lt;percentage&gt; | 0 | 否 | 设置文本y轴偏移 |
| rotate | number | 0 | 否 | 字体以左下角为圆心旋转角度,正数顺时针,负数逆时针 | | rotate | number | 0 | 否 | 字体以左下角为圆心旋转角度,正数顺时针,负数逆时针 |
| font-size | &lt;length&gt; | 30px | 否 | 设置文本的尺寸。 | | font-size | &lt;length&gt; | 30px | 否 | 设置文本的尺寸。 |
| fill | &lt;color&gt; | black | 否 | 字体填充颜色 | | fill | &lt;color&gt; | black | 否 | 字体填充颜色 |
| fill-opacity | number | 1.0 | 否 | 字体填充透明度 | | fill-opacity | number | 1.0 | 否 | 字体填充透明度 |
| opacity | number | 1 | 否 | 元素的透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。支持属性动画。 | | opacity | number | 1 | 否 | 元素的透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。支持属性动画。 |
| stroke | &lt;color&gt; | black | 否 | 绘制字体边框并指定颜色 | | stroke | &lt;color&gt; | black | 否 | 绘制字体边框并指定颜色 |
| stroke-width | number | 1px | 否 | 字体边框宽度 | | stroke-width | number | 1px | 否 | 字体边框宽度 |
| stroke-opacity | number | 1.0 | 否 | 字体边框透明度 | | stroke-opacity | number | 1.0 | 否 | 字体边框透明度 |
## 示例 ## 示例
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: row; flex-direction: row;
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
} }
``` ```
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg> <svg>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
属性动画示例 属性动画示例
``` ```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: row; flex-direction: row;
...@@ -89,15 +89,15 @@ ...@@ -89,15 +89,15 @@
} }
``` ```
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg> <svg>
<text y="50" font-size="30" fill="blue"> <text y="50" font-size="30" fill="blue">
text attribute x|opacity|rotate
<animate attributeName="x" from="100" by="400" dur="3s" repeatCount="indefinite"></animate> <animate attributeName="x" from="100" by="400" dur="3s" repeatCount="indefinite"></animate>
<animate attributeName="opacity" from="0.01" to="0.99" dur="3s" repeatCount="indefinite"></animate> <animate attributeName="opacity" from="0.01" to="0.99" dur="3s" repeatCount="indefinite"></animate>
<animate attributeName="rotate" from="0" to="360" dur="3s" repeatCount="indefinite"></animate> <animate attributeName="rotate" from="0" to="360" dur="3s" repeatCount="indefinite"></animate>
text attribute x|opacity|rotate
</text> </text>
</svg> </svg>
</div> </div>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
![zh-cn_image_0000001173324699](figures/zh-cn_image_0000001173324699.gif) ![zh-cn_image_0000001173324699](figures/zh-cn_image_0000001173324699.gif)
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg> <svg>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
![zh-cn_image_0000001173164783](figures/zh-cn_image_0000001173164783.gif) ![zh-cn_image_0000001173164783](figures/zh-cn_image_0000001173164783.gif)
``` ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<svg> <svg>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册