Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
b793bdfb
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看板
提交
b793bdfb
编写于
7月 28, 2022
作者:
G
gmy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
gmy
<
guanmingyue@h-partners.com
>
上级
1ab958d1
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
71 addition
and
65 deletion
+71
-65
zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md
...plication-dev/reference/apis/js-apis-system-mediaquery.md
+11
-5
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md
...cation-dev/reference/arkui-ts/ts-basic-components-text.md
+19
-19
zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
...ion-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-combined-gestures.md
...pplication-dev/reference/arkui-ts/ts-combined-gestures.md
+9
-9
zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
...eference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
+6
-6
zh-cn/application-dev/reference/arkui-ts/ts-page-transition-animation.md
...on-dev/reference/arkui-ts/ts-page-transition-animation.md
+20
-20
zh-cn/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md
...ence/arkui-ts/ts-universal-component-area-change-event.md
+5
-5
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md
浏览文件 @
b793bdfb
...
...
@@ -38,11 +38,7 @@ matchMedia(condition: string): MediaQueryList
**示例:**
```
export default {
matchMedia() {
var mMediaQueryList = mediaquery.matchMedia('(max-width: 466)');
},
}
var mMediaQueryList = mediaquery.matchMedia('(max-width: 466)');
```
## MediaQueryEvent
...
...
@@ -100,6 +96,11 @@ addListener(callback: (event: MediaQueryEvent) => void): void
**示例:**
```
function maxWidthMatch(){
if(e.mathes){
// do something
}
}
mMediaQueryList.addListener(maxWidthMatch);
```
...
...
@@ -121,6 +122,11 @@ removeListener(callback: (event: MediaQueryEvent) => void): void
**示例:**
```
function maxWidthMatch(){
if(e.mathes){
// do something
}
}
mMediaQueryList.removeListener(maxWidthMatch);
```
...
...
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md
浏览文件 @
b793bdfb
...
...
@@ -24,7 +24,7 @@ Text(content?: string)
-
参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| content | string | 否 | '' | 文本内容
,包含子组件Span时不生效,显示Span内容。 |
| content | string | 否 | '' | 文本内容
。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。 |
## 属性
...
...
zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
浏览文件 @
b793bdfb
...
...
@@ -251,7 +251,7 @@ struct MiterLimit {
```
@Entry
@Component
struct Font {
struct Font
s
{
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-combined-gestures.md
浏览文件 @
b793bdfb
...
...
@@ -43,13 +43,13 @@ struct GestureGroupExample {
@State count: number = 0
@State offsetX: number = 0
@State offsetY: number = 0
@State borderStyle: BorderStyle = BorderStyle.Solid
@State borderStyle
s
: BorderStyle = BorderStyle.Solid
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Text('sequence gesture\n' + 'LongPress onAction:' + this.count + '\nPanGesture offset:\nX: ' + this.offsetX + '\n' + 'Y: ' + this.offsetY)
}.translate({ x: this.offsetX, y: this.offsetY, z: 5 })
.height(100).width(200).padding(10).margin(80).border({ width: 1, style: this.borderStyle })
.height(100).width(200).padding(10).margin(80).border({ width: 1, style: this.borderStyle
s
})
.gesture(
GestureGroup(GestureMode.Sequence,
LongPressGesture({ repeat: true })
...
...
@@ -62,7 +62,7 @@ struct GestureGroupExample {
}),
PanGesture({})
.onActionStart(() => {
this.borderStyle = BorderStyle.Dashed
this.borderStyle
s
= BorderStyle.Dashed
console.log('pan start')
})
.onActionUpdate((event: GestureEvent) => {
...
...
zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md
浏览文件 @
b793bdfb
...
...
@@ -259,7 +259,7 @@ struct MiterLimit {
```
@Entry
@Component
struct Font {
struct Font
s
{
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-page-transition-animation.md
浏览文件 @
b793bdfb
...
...
@@ -68,8 +68,8 @@ PageTransitionEnter和PageTransitionExit组件支持的事件:
@Entry
@Component
struct PageTransitionExample1 {
@State scale: number = 1
@State opacity: number = 1
@State scale
1
: number = 1
@State opacity
1
: number = 1
@State active: boolean = false
build() {
Column() {
...
...
@@ -79,19 +79,19 @@ struct PageTransitionExample1 {
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale
}).opacity(this.opacity
)
}.scale({ x: this.scale
1 }).opacity(this.opacity1
)
}
// 自定义方式1:完全自定义转场过程的效果
pageTransition() {
PageTransitionEnter({ duration: 1200, curve: Curve.Linear })
.onEnter((type: RouteType, progress: number) => {
this.scale = 1
this.opacity = progress
this.scale
1
= 1
this.opacity
1
= progress
}) // 进场过程中会逐帧触发onEnter回调,入参为动效的归一化进度(0% -- 100%)
PageTransitionExit({ duration: 1500, curve: Curve.Ease })
.onExit((type: RouteType, progress: number) => {
this.scale = 1 - progress
this.opacity = 1
this.scale
1
= 1 - progress
this.opacity
1
= 1
}) // 退场过程中会逐帧触发onExit回调,入参为动效的归一化进度(0% -- 100%)
}
}
...
...
@@ -102,27 +102,27 @@ struct PageTransitionExample1 {
@Entry
@Component
struct AExample {
@State scale: number = 1
@State opacity: number = 1
@State scale
2
: number = 1
@State opacity
2
: number = 1
@State active: boolean = false
build() {
Column() {
Navigator({ target: 'pages/index' ,type: NavigationType.Push}) {
Image($r('app.media.bg2')).width("100%").height("100%")
}
}.height("100%").width("100%").scale({ x: this.scale
}).opacity(this.opacity
)
}.height("100%").width("100%").scale({ x: this.scale
2 }).opacity(this.opacity2
)
}
// 自定义方式1:完全自定义转场过程的效果
pageTransition() {
PageTransitionEnter({ duration: 1200, curve: Curve.Linear })
.onEnter((type: RouteType, progress: number) => {
this.scale = 1
this.opacity = progress
this.scale
2
= 1
this.opacity
2
= progress
}) // 进场过程中会逐帧触发onEnter回调,入参为动效的归一化进度(0% -- 100%)
PageTransitionExit({ duration: 1500, curve: Curve.Ease })
.onExit((type: RouteType, progress: number) => {
this.scale = 1 - progress
this.opacity = 1
this.scale
2
= 1 - progress
this.opacity
2
= 1
}) // 退场过程中会逐帧触发onExit回调,入参为动效的归一化进度(0% -- 100%)
}
}
...
...
@@ -137,8 +137,8 @@ struct AExample {
@Entry
@Component
struct PageTransitionExample {
@State scale: number = 1
@State opacity: number = 1
@State scale
1
: number = 1
@State opacity
1
: number = 1
@State active: boolean = false
build() {
...
...
@@ -149,7 +149,7 @@ struct PageTransitionExample {
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale
}).opacity(this.opacity
)
}.scale({ x: this.scale
1 }).opacity(this.opacity1
)
}
// 自定义方式2:使用系统提供的多种默认效果(平移、缩放、透明度等)
...
...
@@ -168,8 +168,8 @@ struct PageTransitionExample {
@Entry
@Component
struct PageTransitionExample1 {
@State scale: number = 1
@State opacity: number = 1
@State scale
2
: number = 1
@State opacity
2
: number = 1
@State active: boolean = false
build() {
...
...
@@ -180,7 +180,7 @@ struct PageTransitionExample1 {
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale
}).opacity(this.opacity
)
}.scale({ x: this.scale
2 }).opacity(this.opacity2
)
}
// 自定义方式2:使用系统提供的多种默认效果(平移、缩放、透明度等)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md
浏览文件 @
b793bdfb
...
...
@@ -23,7 +23,7 @@
@Component
struct AreaExample {
@State value: string = 'Text'
@State size: string = ''
@State size
1
: string = ''
build() {
Column() {
...
...
@@ -34,7 +34,7 @@ struct AreaExample {
})
.onAreaChange((oldValue: Area, newValue: Area) => {
console.info(`Ace: on area change, oldValue is ${JSON.stringify(oldValue)} value is ${JSON.stringify(newValue)}`)
this.size = JSON.stringify(newValue)
this.size
1
= JSON.stringify(newValue)
})
Text('new area is: \n' + this.size).margin({ right: 30, left: 30 })
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录