Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
04c49e02
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
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看板
提交
04c49e02
编写于
11月 07, 2022
作者:
Y
yamila
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update standard cherryPick beta3
Signed-off-by:
N
yamila
<
tianyu55@huawei.com
>
上级
63a60e56
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
413 addition
and
362 deletion
+413
-362
zh-cn/application-dev/quick-start/arkts-state-mgmt-page-level.md
...pplication-dev/quick-start/arkts-state-mgmt-page-level.md
+4
-0
zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127284934.gif
...ference/arkui-js/figures/zh-cn_image_0000001127284934.gif
+0
-0
zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001176075554.gif
...ference/arkui-js/figures/zh-cn_image_0000001176075554.gif
+0
-0
zh-cn/application-dev/reference/arkui-js/js-components-basic-marquee.md
...ion-dev/reference/arkui-js/js-components-basic-marquee.md
+47
-44
zh-cn/application-dev/reference/arkui-js/js-components-basic-picker.md
...tion-dev/reference/arkui-js/js-components-basic-picker.md
+129
-98
zh-cn/application-dev/reference/arkui-js/js-components-container-list.md
...on-dev/reference/arkui-js/js-components-container-list.md
+2
-2
zh-cn/application-dev/reference/arkui-js/js-components-container-panel.md
...n-dev/reference/arkui-js/js-components-container-panel.md
+40
-35
zh-cn/application-dev/reference/arkui-js/js-components-container-popup.md
...n-dev/reference/arkui-js/js-components-container-popup.md
+2
-2
zh-cn/application-dev/reference/arkui-js/js-components-container-stepper.md
...dev/reference/arkui-js/js-components-container-stepper.md
+3
-4
zh-cn/application-dev/reference/arkui-ts/figures/borderImage.gif
...pplication-dev/reference/arkui-ts/figures/borderImage.gif
+0
-0
zh-cn/application-dev/reference/arkui-ts/figures/borderImage.png
...pplication-dev/reference/arkui-ts/figures/borderImage.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/ts-basic-gestures-pangesture.md
...on-dev/reference/arkui-ts/ts-basic-gestures-pangesture.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
...ion-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
+135
-139
zh-cn/application-dev/reference/arkui-ts/ts-combined-gestures.md
...pplication-dev/reference/arkui-ts/ts-combined-gestures.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md
...reference/arkui-ts/ts-components-canvas-canvasgradient.md
+30
-29
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md
...eference/arkui-ts/ts-universal-attributes-border-image.md
+19
-7
未找到文件。
zh-cn/application-dev/quick-start/arkts-state-mgmt-page-level.md
浏览文件 @
04c49e02
...
...
@@ -468,6 +468,10 @@ struct CompC {
装饰器@State、@Prop、@Link、@ObjectLink、@Provide、@Consume、@StorageProp以及@StorageLink所装饰的变量均可以通过@Watch监听其变化。
> **说明:**
>
> 深层次数据修改不会触发@Watch回调,例如无法监听数组中对象值的改变。
```
ts
// xxx.ets
@
Entry
...
...
zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127284934.gif
已删除
100644 → 0
浏览文件 @
63a60e56
217.3 KB
zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001176075554.gif
0 → 100644
浏览文件 @
04c49e02
644.0 KB
zh-cn/application-dev/reference/arkui-js/js-components-basic-marquee.md
浏览文件 @
04c49e02
...
...
@@ -64,74 +64,77 @@
```
html
<!-- xxx.hml -->
<div
class=
"container"
>
<marquee
id=
"customMarquee"
class=
"customMarquee"
scrollamount=
"{{scrollAmount}}"
loop=
"{{loop}}"
direction=
"{{marqueeDir}}"
onbounce=
"onMarqueeBounce"
onstart=
"onMarqueeStart"
onfinish=
"onMarqueeFinish"
>
{{marqueeCustomData}}
</marquee>
<div
class=
"content"
>
<button
class=
"controlButton"
onclick=
"onStartClick"
>
Start
</button>
<button
class=
"controlButton"
onclick=
"onStopClick"
>
Stop
</button>
<div
class=
"tutorial-page"
>
<div
class=
"mymarquee"
>
<marquee
style=
"color: {{color1}}"
loop=
"{{loopval}}"
scrollamount=
"{{scroll}}"
direction=
"{{isleft}}"
class=
"marqueetext"
id=
"testmarquee"
onfinish=
"setfinish"
>
Life is a journey, not the destination.
</marquee>
</div>
<div
style=
"width: 600px;height: 150px;flex-direction: row;justify-content: space-around;"
>
<button
onclick=
"makestart"
value=
"start"
></button>
<button
onclick=
"makestop"
value=
"stop"
></button>
</div>
</div>
```
```
css
/* xxx.css */
.container
{
.tutorial-page
{
width
:
750px
;
height
:
100%
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
background-color
:
#ffffff
;
justify-content
:
center
;
}
.customMarquee
{
width
:
100%
;
height
:
80px
;
padding
:
10px
;
margin
:
20px
;
border
:
4px
solid
#ff8888
;
border-radius
:
20px
;
font-size
:
40px
;
color
:
#ff8888
;
font-weight
:
bolder
;
font-family
:
serif
;
background-color
:
#ffdddd
;
.marqueetext
{
font-size
:
37px
;
}
.content
{
flex-direction
:
row
;
.mymarquee
{
margin-top
:
20px
;
width
:
100%
;
height
:
100px
;
margin-left
:
50px
;
margin-right
:
50px
;
border
:
1px
solid
#dc0f27
;
border-radius
:
15px
;
align-items
:
center
;
}
.controlButton
{
flex-grow
:
1
;
background-color
:
#F2F2F2
;
text-color
:
#0D81F2
;
button
{
width
:
200px
;
height
:
80px
;
margin-top
:
100px
;
}
```
```
js
// xxx.js
export
default
{
data
:
{
scrollAmount
:
30
,
loop
:
3
,
marqueeDir
:
'
left
'
,
marqueeCustomData
:
'
Custom marquee
'
,
},
onMarqueeBounce
:
function
()
{
console
.
log
(
"
onMarqueeBounce
"
);
private
:
{
loopval
:
1
,
scroll
:
8
,
color1
:
'
red
'
},
onMarqueeStart
:
function
()
{
console
.
log
(
"
onMarqueeStart
"
);
onInit
(){
},
onMarqueeFinish
:
function
()
{
console
.
log
(
"
onMarqueeFinish
"
);
setfinish
(
e
)
{
this
.
loopval
=
this
.
loopval
+
1
,
this
.
r
=
Math
.
floor
(
Math
.
random
()
*
255
),
this
.
g
=
Math
.
floor
(
Math
.
random
()
*
255
),
this
.
b
=
Math
.
floor
(
Math
.
random
()
*
255
),
this
.
color1
=
'
rgba(
'
+
this
.
r
+
'
,
'
+
this
.
g
+
'
,
'
+
this
.
b
+
'
,0.8)
'
,
this
.
$element
(
'
testmarquee
'
).
start
(),
this
.
loopval
=
this
.
loopval
-
1
},
onStartClick
(
evt
)
{
this
.
$element
(
'
customMarquee
'
).
start
();
makestart
(
e
)
{
this
.
$element
(
'
testmarquee
'
).
start
()
},
onStopClick
(
evt
)
{
this
.
$element
(
'
customMarquee
'
).
stop
();
makestop
(
e
)
{
this
.
$element
(
'
testmarquee
'
).
stop
()
}
}
```
![
zh-cn_image_00000011
27284934
](
figures/zh-cn_image_000000112728493
4.gif
)
![
zh-cn_image_00000011
76075554
](
figures/zh-cn_image_000000117607555
4.gif
)
zh-cn/application-dev/reference/arkui-js/js-components-basic-picker.md
浏览文件 @
04c49e02
...
...
@@ -165,52 +165,59 @@
```
html
<!-- xxx.hml -->
<div
class=
"container"
>
<select
@
change=
"selectChange"
>
<select
@
change=
"selectChange"
>
<option
value=
"{{ item }}"
for=
"item in selectList"
>
{{ item }}
</option>
</select>
<picker
id=
"picker0"
type=
"text"
value=
"{{textvalue}}"
selected=
"{{textselect}}"
range=
"{{rangetext}}"
onchange=
"textonchange"
oncancel=
"textoncancel"
class=
"pickertext"
></picker>
<picker
id=
"picker1"
type=
"date"
value=
"{{datevalue}}"
start=
"2002-2-5"
end=
"2030-6-5"
selected=
"{{dateselect}}"
lunarswitch=
"true"
onchange=
"dateonchange"
oncancel=
"dateoncancel"
class=
"pickerdate"
show=
"false"
></picker>
<picker
id=
"picker2"
type=
"time"
value=
"{{timevalue}}"
containsecond=
"{{containsecond}}"
selected=
"{{timeselect}}"
hours=
"12"
onchange=
"timeonchange"
oncancel=
"timeoncancel"
class=
"pickertime"
show=
"false"
></picker>
<picker
id=
"picker3"
type=
"datetime"
value=
"{{datetimevalue}}"
selected=
"{{datetimeselect}}"
hours=
"24"
lunarswitch=
"true"
onchange=
"datetimeonchange"
oncancel=
"datetimeoncancel"
class=
"pickerdatetime"
show=
"false"
></picker>
<picker
id=
"picker4"
type=
"multi-text"
value=
"{{multitextvalue}}"
columns=
"3"
range=
"{{multitext}}"
selected=
"{{multitextselect}}"
onchange=
"multitextonchange"
oncancel=
"multitextoncancel"
class=
"pickermuitl"
show=
"false"
></picker>
</select>
<picker
id=
"picker0"
type=
"text"
value=
"{{ textvalue }}"
selected=
"{{ textselect }}"
range=
"{{ rangetext }}"
onchange=
"textonchange"
oncancel=
"textoncancel"
class=
"pickertext"
show=
"false"
></picker>
<picker
id=
"picker1"
type=
"date"
value=
"{{ datevalue }}"
start=
"2002-2-5"
end=
"2030-6-5"
selected=
"{{ dateselect }}"
lunarswitch=
"true"
onchange=
"dateonchange"
oncancel=
"dateoncancel"
class=
"pickerdate"
show=
"false"
></picker>
<picker
id=
"picker2"
type=
"time"
value=
"{{ timevalue }}"
containsecond=
"{{ containsecond }}"
selected=
"{{ timeselect }}"
hours=
"12"
onchange=
"timeonchange"
oncancel=
"timeoncancel"
class=
"pickertime"
show=
"false"
></picker>
<picker
id=
"picker3"
type=
"datetime"
value=
"{{ datetimevalue }}"
selected=
"{{ datetimeselect }}"
hours=
"24"
lunarswitch=
"true"
onchange=
"datetimeonchange"
oncancel=
"datetimeoncancel"
class=
"pickerdatetime"
show=
"false"
></picker>
<picker
id=
"picker4"
type=
"multi-text"
value=
"{{ multitextvalue }}"
columns=
"3"
range=
"{{ multitext }}"
selected=
"{{ multitextselect }}"
onchange=
"multitextonchange"
oncancel=
"multitextoncancel"
class=
"pickermuitl"
show=
"false"
></picker>
</div>
```
```
css
/* xxx.css */
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
picker
{
width
:
60%
;
height
:
80px
;
border-radius
:
20px
;
text-color
:
white
;
font-size
:
15px
;
background-color
:
#4747e3
;
margin-left
:
20%
;
picker
{
width
:
60%
;
height
:
80px
;
border-radius
:
20px
;
text-color
:
white
;
font-size
:
15px
;
background-color
:
#4747e3
;
margin-left
:
20%
;
}
select
{
background-color
:
#efecec
;
height
:
50px
;
width
:
60%
;
margin-left
:
20%
;
margin-top
:
300px
;
margin-bottom
:
50px
;
font-size
:
22px
;
select
{
background-color
:
#efecec
;
height
:
50px
;
width
:
60%
;
margin-left
:
20%
;
margin-top
:
300px
;
margin-bottom
:
50px
;
font-size
:
22px
;
}
```
...
...
@@ -218,72 +225,96 @@
// xxx.js
import
router
from
'
@system.router
'
;
import
prompt
from
'
@system.prompt
'
;
export
default
{
data
:
{
selectList
:[
"
text
"
,
"
data
"
,
"
time
"
,
"
datetime
"
,
"
multitext
"
],
rangetext
:[
'
15
'
,
"
20
"
,
"
25
"
],
multitext
:[[
"
a
"
,
"
b
"
,
"
c
"
],
[
"
e
"
,
"
f
"
,
"
g
"
],
[
"
h
"
,
"
i
"
],
[
"
k
"
,
"
l
"
,
"
m
"
]],
textvalue
:
'
default textvalue
'
,
datevalue
:
'
default datevalue
'
,
timevalue
:
'
default timevalue
'
,
datetimevalue
:
'
default datetimevalue
'
,
multitextvalue
:
'
default multitextvalue
'
,
containsecond
:
true
,
multitextselect
:[
1
,
2
,
0
],
datetimeselect
:
'
2012-5-6-11-25
'
,
timeselect
:
'
11:22:30
'
,
dateselect
:
'
2021-3-2
'
,
textselect
:
'
2
'
},
selectChange
(
e
)
{
for
(
let
i
=
0
;
i
<
this
.
selectList
.
length
;
i
++
)
{
if
(
e
.
newValue
==
this
.
selectList
[
i
])
{
this
.
$element
(
"
picker
"
+
i
).
show
();
data
:
{
selectList
:
[
"
text
"
,
"
data
"
,
"
time
"
,
"
datetime
"
,
"
multitext
"
],
rangetext
:
[
'
15
'
,
"
20
"
,
"
25
"
],
multitext
:
[[
"
a
"
,
"
b
"
,
"
c
"
],
[
"
e
"
,
"
f
"
,
"
g
"
],
[
"
h
"
,
"
i
"
],
[
"
k
"
,
"
l
"
,
"
m
"
]],
textvalue
:
'
default textvalue
'
,
datevalue
:
'
default datevalue
'
,
timevalue
:
'
default timevalue
'
,
datetimevalue
:
'
default datetimevalue
'
,
multitextvalue
:
'
default multitextvalue
'
,
containsecond
:
true
,
multitextselect
:
[
1
,
2
,
0
],
datetimeselect
:
'
2012-5-6-11-25
'
,
timeselect
:
'
11:22:30
'
,
dateselect
:
'
2021-3-2
'
,
textselect
:
'
2
'
},
selectChange
(
e
)
{
for
(
let
i
=
0
;
i
<
this
.
selectList
.
length
;
i
++
)
{
if
(
e
.
newValue
==
this
.
selectList
[
i
])
{
this
.
$element
(
"
picker
"
+
i
).
show
();
}
}
},
textonchange
(
e
)
{
this
.
textvalue
=
e
.
newValue
;
prompt
.
showToast
({
message
:
"
text:
"
+
e
.
newValue
+
"
,newSelected:
"
+
e
.
newSelected
})
},
textoncancel
(
e
)
{
prompt
.
showToast
({
message
:
"
text: textoncancel
"
})
},
dateonchange
(
e
)
{
this
.
datevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
;
prompt
.
showToast
({
message
:
"
date:
"
+
e
.
year
+
"
-
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
})
},
dateoncancel
()
{
prompt
.
showToast
({
message
:
"
date: dateoncancel
"
})
},
timeonchange
(
e
)
{
if
(
this
.
containsecond
){
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
;
prompt
.
showToast
({
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
})
}
else
{
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
;
prompt
.
showToast
({
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
})
}},
timeoncancel
()
{
prompt
.
showToast
({
message
:
"
timeoncancel
"
})
},
datetimeonchange
(
e
)
{
this
.
datetimevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
;
prompt
.
showToast
({
message
:
"
Time:
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
})
},
datetimeoncancel
()
{
prompt
.
showToast
({
message
:
"
datetimeoncancel
"
})
},
multitextonchange
(
e
)
{
this
.
multitextvalue
=
e
.
newValue
;
prompt
.
showToast
({
message
:
"
Multi-column text change
"
+
e
.
newValue
})
},
multitextoncancel
()
{
prompt
.
showToast
({
message
:
"
multitextoncancel
"
})
},
popup_picker
()
{
this
.
$element
(
"
picker_text
"
).
show
();
},
textonchange
(
e
)
{
this
.
textvalue
=
e
.
newValue
;
prompt
.
showToast
({
message
:
"
text:
"
+
e
.
newValue
+
"
,newSelected:
"
+
e
.
newSelected
})
},
textoncancel
(
e
)
{
prompt
.
showToast
({
message
:
"
text: textoncancel
"
})
},
dateonchange
(
e
)
{
this
.
datevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
;
prompt
.
showToast
({
message
:
"
date:
"
+
e
.
year
+
"
-
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
})
},
dateoncancel
()
{
prompt
.
showToast
({
message
:
"
date: dateoncancel
"
})
},
timeonchange
(
e
)
{
if
(
this
.
containsecond
)
{
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
;
prompt
.
showToast
({
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
})
}
else
{
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
;
prompt
.
showToast
({
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
})
}
},
timeoncancel
()
{
prompt
.
showToast
({
message
:
"
timeoncancel
"
})
},
datetimeonchange
(
e
)
{
this
.
datetimevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
;
prompt
.
showToast
({
message
:
"
Time:
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
})
},
datetimeoncancel
()
{
prompt
.
showToast
({
message
:
"
datetimeoncancel
"
})
},
multitextonchange
(
e
)
{
this
.
multitextvalue
=
e
.
newValue
;
prompt
.
showToast
({
message
:
"
Multi-column text change
"
+
e
.
newValue
})
},
multitextoncancel
()
{
prompt
.
showToast
({
message
:
"
multitextoncancel
"
})
},
popup_picker
()
{
this
.
$element
(
"
picker_text
"
).
show
();
},
}
```
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-list.md
浏览文件 @
04c49e02
...
...
@@ -118,10 +118,10 @@ export default {
data
:
{
todolist
:
[{
title
:
'
刷题
'
,
date
:
'
2021-12-31 10:00:00
'
,
date
:
'
2021-12-31 10:00:00
'
},
{
title
:
'
看电影
'
,
date
:
'
2021-12-31 20:00:00
'
,
date
:
'
2021-12-31 20:00:00
'
}],
},
}
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-panel.md
浏览文件 @
04c49e02
...
...
@@ -85,58 +85,63 @@
```
html
<!-- xxx.hml -->
<div
class=
"doc-page"
>
<div
class=
"btn-div"
>
<button
type=
"capsule"
value=
"Click here"
onclick=
"showPanel"
></button>
</div>
<panel
id=
"simplepanel"
type=
"foldable"
mode=
"half"
onsizechange=
"changeMode"
miniheight=
"200px"
>
<div
class=
"panel-div"
>
<div
class=
"inner-txt"
>
<text
class=
"txt"
>
Simple panel in {{modeFlag}} mode
</text>
</div>
<div
class=
"inner-btn"
>
<button
type=
"capsule"
value=
"Close"
onclick=
"closePanel"
></button>
</div>
<div
class=
"btn-div"
>
<button
type=
"capsule"
value=
"Click here"
onclick=
"showPanel"
></button>
</div>
</panel>
<panel
id=
"simplepanel"
type=
"foldable"
mode=
"half"
onsizechange=
"changeMode"
miniheight=
"200px"
>
<div
class=
"panel-div"
>
<div
class=
"inner-txt"
>
<text
class=
"txt"
>
Simple panel in {{ modeFlag }} mode
</text>
</div>
<div
class=
"inner-btn"
>
<button
type=
"capsule"
value=
"Close"
onclick=
"closePanel"
></button>
</div>
</div>
</panel>
</div>
```
```
css
/* xxx.css */
.doc-page
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.btn-div
{
width
:
100%
;
height
:
200px
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
height
:
200px
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.txt
{
color
:
#000000
;
font-weight
:
bold
;
font-size
:
39px
;
color
:
#000000
;
font-weight
:
bold
;
font-size
:
39px
;
}
.panel-div
{
width
:
100%
;
flex-direction
:
column
;
align-items
:
center
;
width
:
100%
;
flex-direction
:
column
;
align-items
:
center
;
}
.inner-txt
{
width
:
100%
;
height
:
160px
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
height
:
160px
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.inner-btn
{
width
:
100%
;
height
:
120px
;
justify-content
:
center
;
align-items
:
center
;
width
:
100%
;
height
:
120px
;
justify-content
:
center
;
align-items
:
center
;
}
```
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-popup.md
浏览文件 @
04c49e02
...
...
@@ -115,7 +115,7 @@ export default {
visibilitychange
(
e
)
{
prompt
.
showToast
({
message
:
'
visibility change visibility:
'
+
e
.
visibility
,
duration
:
3000
,
duration
:
3000
});
},
showpopup
()
{
...
...
@@ -123,7 +123,7 @@ export default {
},
hidepopup
()
{
this
.
$element
(
"
popup
"
).
hide
();
}
,
}
}
```
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-stepper.md
浏览文件 @
04c49e02
...
...
@@ -66,19 +66,19 @@
<stepper
class=
"stepper"
id=
"mystepper"
index=
"0"
onnext=
"nextclick"
onback=
"backclick"
>
<stepper-item
class =
"stepperItem"
label=
"{{label_1}}"
>
<div
class =
"stepperItemContent"
>
<text
class =
"text"
>
First screen
</text>
<text>
First screen
</text>
</div>
<button
type=
"capsule"
class =
"button"
value=
"setRightButtonStatus"
onclick=
"setRightButton"
></button>
</stepper-item>
<stepper-item
class =
"stepperItem"
label=
"{{label_2}}"
>
<div
class =
"stepperItemContent"
>
<text
class =
"text"
>
Second screen
</text>
<text>
Second screen
</text>
</div>
<button
type=
"capsule"
class =
"button"
value=
"setRightButtonStatus"
onclick=
"setRightButton"
></button>
</stepper-item>
<stepper-item
class =
"stepperItem"
label=
"{{label_3}}"
>
<div
class =
"stepperItemContent"
>
<text
class =
"text"
>
Third screen
</text>
<text>
Third screen
</text>
</div>
<button
type=
"capsule"
class =
"button"
value=
"setRightButtonStatus"
onclick=
"setRightButton"
></button>
</stepper-item>
...
...
@@ -100,7 +100,6 @@
align-items
:
center
;
}
.stepperItemContent
{
color
:
#0000ff
;
font-size
:
50px
;
justify-content
:
center
;
}
...
...
zh-cn/application-dev/reference/arkui-ts/figures/borderImage.gif
0 → 100644
浏览文件 @
04c49e02
76.8 KB
zh-cn/application-dev/reference/arkui-ts/figures/borderImage.png
已删除
100644 → 0
浏览文件 @
63a60e56
5.2 KB
zh-cn/application-dev/reference/arkui-ts/ts-basic-gestures-pangesture.md
浏览文件 @
04c49e02
...
...
@@ -17,7 +17,7 @@ PanGesture(value?: { fingers?: number; direction?: PanDirection; distance?: numb
| -------- | -------- | -------- | -------- |
| fingers | number | 否 | 触发拖动的最少手指数,最小为1指,
最大取值为10指。
<br/>
默认值:1 |
| direction | PanDirection | 否 | 触发拖动的手势方向,此枚举值支持逻辑与(
&
)和逻辑或(
\|
)运算。
<br/>
默认值:PanDirection.All |
| distance | number | 否 | 最小拖动识别距离,单位为vp。
<br/>
默认值:5.0
<br/>
**说明:**
<br/>
>
tab
滑动与该拖动手势事件同时存在时,可将distance值设为1,使拖动更灵敏,避免造成事件错乱。 |
| distance | number | 否 | 最小拖动识别距离,单位为vp。
<br/>
默认值:5.0
<br/>
**说明:**
<br/>
>
[
Tabs组件
](
ts-container-tabs.md
)
滑动与该拖动手势事件同时存在时,可将distance值设为1,使拖动更灵敏,避免造成事件错乱。 |
## PanDirection枚举说明
...
...
zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md
浏览文件 @
04c49e02
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/arkui-ts/ts-combined-gestures.md
浏览文件 @
04c49e02
...
...
@@ -56,7 +56,7 @@ struct GestureGroupExample {
.
margin
(
20
)
.
border
({
width
:
3
,
style
:
this
.
borderStyles
})
.
gesture
(
//以下组合手势为顺序识别,当长按手势事件未正常触发时则不会触发拖动手势事件
//
以下组合手势为顺序识别,当长按手势事件未正常触发时则不会触发拖动手势事件
GestureGroup
(
GestureMode
.
Sequence
,
LongPressGesture
({
repeat
:
true
})
.
onAction
((
event
:
GestureEvent
)
=>
{
...
...
zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md
浏览文件 @
04c49e02
...
...
@@ -17,40 +17,41 @@ addColorStop(offset: number, color: string): void
**参数:**
| 参数 | 类型 | 必填 | 默认值 | 描述 |
| ------ | ------ | ---- | --------- | ---------------------------- |
| offset | number | 是 | 0 | 设置渐变点距离起点的位置占总体长度的比例,范围为0到1。 |
| color | string | 是 | '#ffffff' | 设置渐变的颜色。 |
| 参数 | 类型 | 必填 | 默认值 | 描述 |
| ------ | ------ | ---- | --------- | ---------------------------- |
| offset | number | 是 | 0 | 设置渐变点距离起点的位置占总体长度的比例,范围为0到1。 |
| color | string | 是 | '#ffffff' | 设置渐变的颜色。 |
**示例:**
```
ts
// xxx.ets
@
Entry
@
Component
struct
Page45
{
private
settings
:
RenderingContextSettings
=
new
RenderingContextSettings
(
true
)
private
context
:
CanvasRenderingContext2D
=
new
CanvasRenderingContext2D
(
this
.
settings
)
build
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Center
,
justifyContent
:
FlexAlign
.
Center
})
{
Canvas
(
this
.
context
)
.
width
(
'
100%
'
)
.
height
(
'
100%
'
)
.
backgroundColor
(
'
#ffff00
'
)
.
onReady
(()
=>
{
var
grad
=
this
.
context
.
createLinearGradient
(
50
,
0
,
300
,
100
)
grad
.
addColorStop
(
0.0
,
'
red
'
)
grad
.
addColorStop
(
0.5
,
'
white
'
)
grad
.
addColorStop
(
1.0
,
'
green
'
)
this
.
context
.
fillStyle
=
grad
this
.
context
.
fillRect
(
0
,
0
,
500
,
500
)
})
}
.
width
(
'
100%
'
)
.
height
(
'
100%
'
)
}}
// xxx.ets
@
Entry
@
Component
struct
Page45
{
private
settings
:
RenderingContextSettings
=
new
RenderingContextSettings
(
true
)
private
context
:
CanvasRenderingContext2D
=
new
CanvasRenderingContext2D
(
this
.
settings
)
build
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Center
,
justifyContent
:
FlexAlign
.
Center
})
{
Canvas
(
this
.
context
)
.
width
(
'
100%
'
)
.
height
(
'
100%
'
)
.
backgroundColor
(
'
#ffff00
'
)
.
onReady
(()
=>
{
var
grad
=
this
.
context
.
createLinearGradient
(
50
,
0
,
300
,
100
)
grad
.
addColorStop
(
0.0
,
'
red
'
)
grad
.
addColorStop
(
0.5
,
'
white
'
)
grad
.
addColorStop
(
1.0
,
'
green
'
)
this
.
context
.
fillStyle
=
grad
this
.
context
.
fillRect
(
0
,
0
,
500
,
500
)
})
}
.
width
(
'
100%
'
)
.
height
(
'
100%
'
)
}
}
```
!
[
zh-cn_image_0000001194032516
](
figures/zh-cn_image_0000001194032516.png
)
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md
浏览文件 @
04c49e02
...
...
@@ -41,19 +41,31 @@
@
Entry
@
Component
struct
Index
{
@
State
outSetValue
:
number
=
40
build
()
{
Row
()
{
Column
()
{
Text
(
'
This is borderImage.
'
).
textAlign
(
TextAlign
.
Center
)
Text
(
'
This is borderImage.
'
).
textAlign
(
TextAlign
.
Center
)
.
fontSize
(
50
)
.
borderImage
({
source
:
"
borderOrigin.png
"
,
slice
:
{
top
:
"
31%
"
,
bottom
:
"
31%
"
,
left
:
"
31%
"
,
right
:
"
31%
"
}
,
width
:
{
top
:
"
20px
"
,
bottom
:
"
20px
"
,
left
:
"
20px
"
,
right
:
"
20px
"
}
,
outset
:
{
top
:
"
5px
"
,
bottom
:
"
5px
"
,
left
:
"
5px
"
,
right
:
"
5px
"
}
,
source
:
$r
(
'
app.media.heart
'
)
,
slice
:
`
${
this
.
outSetValue
}
%`
,
width
:
`
${
this
.
outSetValue
}
px`
,
outset
:
'
5px
'
,
repeat
:
RepeatMode
.
Repeat
,
fill
:
false
})
Slider
({
value
:
this
.
outSetValue
,
min
:
0
,
max
:
100
,
style
:
SliderStyle
.
OutSet
})
.
margin
({
top
:
30
})
.
onChange
((
value
:
number
,
mode
:
SliderChangeMode
)
=>
{
this
.
outSetValue
=
value
;
console
.
info
(
'
value:
'
+
value
+
'
mode:
'
+
mode
.
toString
());
})
}
.
width
(
'
100%
'
)
}
...
...
@@ -62,7 +74,7 @@ struct Index {
}
```
![
zh-cn_image_borderImage
](
figures/borderImage.
png
)
![
zh-cn_image_borderImage
](
figures/borderImage.
gif
)
```
ts
...
...
@@ -73,7 +85,7 @@ struct Index {
build
()
{
Row
()
{
Column
()
{
Text
(
'
This is gradient color.
'
).
textAlign
(
TextAlign
.
Center
)
Text
(
'
This is gradient color.
'
).
textAlign
(
TextAlign
.
Center
)
.
width
(
68
)
.
borderImage
({
source
:
{
angle
:
90
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录