Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
42f6f5a1
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
42f6f5a1
编写于
7月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6998 PR同步
Merge pull request !6998 from LiAn/OpenHarmony-3.1-Release
上级
d76e3ae4
961965ba
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
32 deletion
+32
-32
zh-cn/application-dev/reference/arkui-js/js-components-svg-text.md
...lication-dev/reference/arkui-js/js-components-svg-text.md
+30
-30
zh-cn/application-dev/ui/ts-custom-component-initialization.md
.../application-dev/ui/ts-custom-component-initialization.md
+1
-1
zh-cn/application-dev/ui/ts-syntactic-sugar.md
zh-cn/application-dev/ui/ts-syntactic-sugar.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/arkui-js/js-components-svg-text.md
浏览文件 @
42f6f5a1
...
@@ -3,14 +3,14 @@
...
@@ -3,14 +3,14 @@
文本,用于呈现一段信息。
文本,用于呈现一段信息。
>

**说明:**
> **说明:**
> - 该组件从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
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置组件左上角x轴坐标
|
| x
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置组件左上角x轴坐标
|
| y
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置组件左上角y轴坐标
|
| y
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置组件左上角y轴坐标
|
| dx
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置文本x轴偏移
|
| dx
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置文本x轴偏移
|
| dy
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置文本y轴偏移
|
| dy
|
<
length
>
\|
<
percentage
>
| 0 | 否 | 设置文本y轴偏移
|
| rotate
| number | 0 | 否 | 字体以左下角为圆心旋转角度,正数顺时针,负数逆时针
|
| rotate
| number | 0 | 否 | 字体以左下角为圆心旋转角度,正数顺时针,负数逆时针
|
| font-size
|
<
length
>
| 30px | 否 | 设置文本的尺寸。
|
| font-size
|
<
length
>
| 30px | 否 | 设置文本的尺寸。
|
| fill
|
<
color
>
| black | 否 | 字体填充颜色
|
| fill
|
<
color
>
| 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
|
<
color
>
| black | 否 | 绘制字体边框并指定颜色
|
| stroke
|
<
color
>
| 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 @@


```
```
html
<!-- xxx.hml -->
<!-- xxx.hml -->
<div
class=
"container"
>
<div
class=
"container"
>
<svg>
<svg>
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@


```
```
html
<!-- xxx.hml -->
<!-- xxx.hml -->
<div
class=
"container"
>
<div
class=
"container"
>
<svg>
<svg>
...
...
zh-cn/application-dev/ui/ts-custom-component-initialization.md
浏览文件 @
42f6f5a1
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
-
在构造组件时通过构造参数初始化,例如:
-
在构造组件时通过构造参数初始化,例如:
```
```
MyComponent(
counter: $myCounter
)
MyComponent(
{counter: $myCounter}
)
```
```
...
...
zh-cn/application-dev/ui/ts-syntactic-sugar.md
浏览文件 @
42f6f5a1
...
@@ -44,7 +44,7 @@ struct MyComponent {
...
@@ -44,7 +44,7 @@ struct MyComponent {
| @Component | struct | 结构体在装饰后具有基于组件的能力,需要实现build方法来更新UI。 |
| @Component | struct | 结构体在装饰后具有基于组件的能力,需要实现build方法来更新UI。 |
| @Entry | struct | 组件被装饰后作为页面的入口,页面加载时将被渲染显示。 |
| @Entry | struct | 组件被装饰后作为页面的入口,页面加载时将被渲染显示。 |
| @Preview | struct | 用@Preview装饰的自定义组件可以在DevEco
Studio的预览器上进行预览,加载页面时,将创建并呈现@Preview装饰的自定义组件。 |
| @Preview | struct | 用@Preview装饰的自定义组件可以在DevEco
Studio的预览器上进行预览,加载页面时,将创建并呈现@Preview装饰的自定义组件。 |
| @Builder | 方法 | 在@Builder装饰的方法
用
通过声明式UI描述,可以在一个自定义组件内快速生成多个布局内容。 |
| @Builder | 方法 | 在@Builder装饰的方法
里,
通过声明式UI描述,可以在一个自定义组件内快速生成多个布局内容。 |
| @Extend | 方法 | @Extend装饰器将新的属性函数添加到内置组件上,通过@Extend装饰器可以快速定义并复用组件的自定义样式。 |
| @Extend | 方法 | @Extend装饰器将新的属性函数添加到内置组件上,通过@Extend装饰器可以快速定义并复用组件的自定义样式。 |
| @CustomDialog | struct | @CustomDialog装饰器用于装饰自定义弹窗。 |
| @CustomDialog | struct | @CustomDialog装饰器用于装饰自定义弹窗。 |
| @State | 基本数据类型,类,数组 | 修饰的状态数据被修改时会触发组件的build方法进行UI界面更新。 |
| @State | 基本数据类型,类,数组 | 修饰的状态数据被修改时会触发组件的build方法进行UI界面更新。 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录