Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
08b2da61
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
08b2da61
编写于
12月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!12286 新接口替代router和prompt错误码废弃接口
Merge pull request !12286 from 田雨/master
上级
2ea2ab8c
88f26692
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
73 addition
and
73 deletion
+73
-73
zh-cn/application-dev/quick-start/arkts-basic-ui-description.md
...application-dev/quick-start/arkts-basic-ui-description.md
+1
-1
zh-cn/application-dev/quick-start/start-with-ets-fa.md
zh-cn/application-dev/quick-start/start-with-ets-fa.md
+1
-1
zh-cn/application-dev/quick-start/start-with-ets-stage.md
zh-cn/application-dev/quick-start/start-with-ets-stage.md
+1
-1
zh-cn/application-dev/reference/arkui-js/js-components-basic-input.md
...ation-dev/reference/arkui-js/js-components-basic-input.md
+7
-7
zh-cn/application-dev/reference/arkui-js/js-components-basic-menu.md
...cation-dev/reference/arkui-js/js-components-basic-menu.md
+2
-2
zh-cn/application-dev/reference/arkui-js/js-components-basic-picker.md
...tion-dev/reference/arkui-js/js-components-basic-picker.md
+12
-13
zh-cn/application-dev/reference/arkui-js/js-components-basic-rating.md
...tion-dev/reference/arkui-js/js-components-basic-rating.md
+2
-2
zh-cn/application-dev/reference/arkui-js/js-components-basic-switch.md
...tion-dev/reference/arkui-js/js-components-basic-switch.md
+5
-5
zh-cn/application-dev/reference/arkui-js/js-components-basic-textarea.md
...on-dev/reference/arkui-js/js-components-basic-textarea.md
+2
-2
zh-cn/application-dev/reference/arkui-js/js-components-canvas-imagedata.md
...-dev/reference/arkui-js/js-components-canvas-imagedata.md
+2
-2
zh-cn/application-dev/reference/arkui-js/js-components-common-methods.md
...on-dev/reference/arkui-js/js-components-common-methods.md
+4
-4
zh-cn/application-dev/reference/arkui-js/js-components-common-transition.md
...dev/reference/arkui-js/js-components-common-transition.md
+1
-1
zh-cn/application-dev/reference/arkui-js/js-components-container-dialog.md
...-dev/reference/arkui-js/js-components-container-dialog.md
+5
-5
zh-cn/application-dev/reference/arkui-js/js-components-container-div.md
...ion-dev/reference/arkui-js/js-components-container-div.md
+12
-12
zh-cn/application-dev/reference/arkui-js/js-components-container-list-item-group.md
...rence/arkui-js/js-components-container-list-item-group.md
+3
-3
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-refresh.md
...dev/reference/arkui-js/js-components-container-refresh.md
+3
-3
zh-cn/application-dev/reference/arkui-js/js-components-grid-col.md
...lication-dev/reference/arkui-js/js-components-grid-col.md
+3
-3
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
...ation-dev/reference/arkui-ts/ts-basic-components-image.md
+2
-1
zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md
...n-dev/reference/arkui-ts/ts-universal-events-show-hide.md
+3
-3
未找到文件。
zh-cn/application-dev/quick-start/arkts-basic-ui-description.md
浏览文件 @
08b2da61
...
@@ -144,7 +144,7 @@ Text(`count: ${this.count}`)
...
@@ -144,7 +144,7 @@ Text(`count: ${this.count}`)
...
...
Button
(
'
add counter
'
)
Button
(
'
add counter
'
)
.
onClick
(
this
.
myClickHandler
)
.
onClick
(
this
.
myClickHandler
.
bind
(
this
)
)
```
```
### 子组件配置
### 子组件配置
...
...
zh-cn/application-dev/quick-start/start-with-ets-fa.md
浏览文件 @
08b2da61
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
.
height
(
'
5%
'
)
.
height
(
'
5%
'
)
// 跳转按钮绑定onClick事件,点击时跳转到第二页
// 跳转按钮绑定onClick事件,点击时跳转到第二页
.
onClick
(()
=>
{
.
onClick
(()
=>
{
router
.
push
({
url
:
'
pages/second
'
})
router
.
push
Url
({
url
:
'
pages/second
'
})
})
})
}
}
.
width
(
'
100%
'
)
.
width
(
'
100%
'
)
...
...
zh-cn/application-dev/quick-start/start-with-ets-stage.md
浏览文件 @
08b2da61
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
.
height
(
'
5%
'
)
.
height
(
'
5%
'
)
// 跳转按钮绑定onClick事件,点击时跳转到第二页
// 跳转按钮绑定onClick事件,点击时跳转到第二页
.
onClick
(()
=>
{
.
onClick
(()
=>
{
router
.
push
({
url
:
'
pages/Second
'
})
router
.
push
Url
({
url
:
'
pages/Second
'
})
})
})
}
}
.
width
(
'
100%
'
)
.
width
(
'
100%
'
)
...
...
zh-cn/application-dev/reference/arkui-js/js-components-basic-input.md
浏览文件 @
08b2da61
...
@@ -125,16 +125,16 @@
...
@@ -125,16 +125,16 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
import
prompt
Action
from
'
@ohos.promptAction
'
export
default
{
export
default
{
change
(
e
){
change
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
value:
"
+
e
.
value
,
message
:
"
value:
"
+
e
.
value
,
duration
:
3000
,
duration
:
3000
,
});
});
},
},
enterkeyClick
(
e
){
enterkeyClick
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
enterkey clicked
"
,
message
:
"
enterkey clicked
"
,
duration
:
3000
,
duration
:
3000
,
});
});
...
@@ -192,10 +192,10 @@
...
@@ -192,10 +192,10 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
import
prompt
Action
from
'
@ohos.promptAction
'
export
default
{
export
default
{
checkboxOnChange
(
e
)
{
checkboxOnChange
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
checked:
'
+
e
.
checked
,
message
:
'
checked:
'
+
e
.
checked
,
duration
:
3000
,
duration
:
3000
,
});
});
...
@@ -227,11 +227,11 @@
...
@@ -227,11 +227,11 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
import
prompt
Action
from
'
@ohos.promptAction
'
export
default
{
export
default
{
onRadioChange
(
inputValue
,
e
)
{
onRadioChange
(
inputValue
,
e
)
{
if
(
inputValue
===
e
.
value
)
{
if
(
inputValue
===
e
.
value
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
The chosen radio is
'
+
e
.
value
,
message
:
'
The chosen radio is
'
+
e
.
value
,
duration
:
3000
,
duration
:
3000
,
});
});
...
...
zh-cn/application-dev/reference/arkui-js/js-components-basic-menu.md
浏览文件 @
08b2da61
...
@@ -90,10 +90,10 @@
...
@@ -90,10 +90,10 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
onMenuSelected
(
e
)
{
onMenuSelected
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
e
.
value
message
:
e
.
value
})
})
},
},
...
...
zh-cn/application-dev/reference/arkui-js/js-components-basic-picker.md
浏览文件 @
08b2da61
...
@@ -223,8 +223,7 @@ select {
...
@@ -223,8 +223,7 @@ select {
```
js
```
js
// xxx.js
// xxx.js
import
router
from
'
@system.router
'
;
import
promptAction
from
'
@ohos.promptAction
'
;
import
prompt
from
'
@system.prompt
'
;
export
default
{
export
default
{
data
:
{
data
:
{
...
@@ -252,63 +251,63 @@ export default {
...
@@ -252,63 +251,63 @@ export default {
},
},
textonchange
(
e
)
{
textonchange
(
e
)
{
this
.
textvalue
=
e
.
newValue
;
this
.
textvalue
=
e
.
newValue
;
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
text:
"
+
e
.
newValue
+
"
,newSelected:
"
+
e
.
newSelected
message
:
"
text:
"
+
e
.
newValue
+
"
,newSelected:
"
+
e
.
newSelected
})
})
},
},
textoncancel
(
e
)
{
textoncancel
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
text: textoncancel
"
message
:
"
text: textoncancel
"
})
})
},
},
dateonchange
(
e
)
{
dateonchange
(
e
)
{
this
.
datevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
;
this
.
datevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
;
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
date:
"
+
e
.
year
+
"
-
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
message
:
"
date:
"
+
e
.
year
+
"
-
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
})
})
},
},
dateoncancel
()
{
dateoncancel
()
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
date: dateoncancel
"
message
:
"
date: dateoncancel
"
})
})
},
},
timeonchange
(
e
)
{
timeonchange
(
e
)
{
if
(
this
.
containsecond
)
{
if
(
this
.
containsecond
)
{
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
;
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
;
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
+
"
:
"
+
e
.
second
})
})
}
else
{
}
else
{
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
;
this
.
timevalue
=
e
.
hour
+
"
:
"
+
e
.
minute
;
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
message
:
"
Time:
"
+
e
.
hour
+
"
:
"
+
e
.
minute
})
})
}
}
},
},
timeoncancel
()
{
timeoncancel
()
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
timeoncancel
"
message
:
"
timeoncancel
"
})
})
},
},
datetimeonchange
(
e
)
{
datetimeonchange
(
e
)
{
this
.
datetimevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
;
this
.
datetimevalue
=
e
.
year
+
"
-
"
+
e
.
month
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
;
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
Time:
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
message
:
"
Time:
"
+
(
e
.
month
+
1
)
+
"
-
"
+
e
.
day
+
"
"
+
e
.
hour
+
"
:
"
+
e
.
minute
})
})
},
},
datetimeoncancel
()
{
datetimeoncancel
()
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
datetimeoncancel
"
message
:
"
datetimeoncancel
"
})
})
},
},
multitextonchange
(
e
)
{
multitextonchange
(
e
)
{
this
.
multitextvalue
=
e
.
newValue
;
this
.
multitextvalue
=
e
.
newValue
;
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
Multi-column text change
"
+
e
.
newValue
message
:
"
Multi-column text change
"
+
e
.
newValue
})
})
},
},
multitextoncancel
()
{
multitextoncancel
()
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
multitextoncancel
"
message
:
"
multitextoncancel
"
})
})
},
},
...
...
zh-cn/application-dev/reference/arkui-js/js-components-basic-rating.md
浏览文件 @
08b2da61
...
@@ -83,10 +83,10 @@ rating {
...
@@ -83,10 +83,10 @@ rating {
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
changeRating
(
e
){
changeRating
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
e
.
rating
message
:
e
.
rating
});
});
}
}
...
...
zh-cn/application-dev/reference/arkui-js/js-components-basic-switch.md
浏览文件 @
08b2da61
...
@@ -91,29 +91,29 @@
...
@@ -91,29 +91,29 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
data
:
{
data
:
{
title
:
'
World
'
title
:
'
World
'
},
},
switchChange
(
e
)
{
switchChange
(
e
)
{
if
(
e
.
checked
)
{
if
(
e
.
checked
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
打开开关
"
message
:
"
打开开关
"
});
});
}
else
{
}
else
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
关闭开关
"
message
:
"
关闭开关
"
});
});
}
}
},
},
normalswitchChange
(
e
)
{
normalswitchChange
(
e
)
{
if
(
e
.
checked
)
{
if
(
e
.
checked
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
switch on
"
message
:
"
switch on
"
});
});
}
else
{
}
else
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
switch off
"
message
:
"
switch off
"
});
});
}
}
...
...
zh-cn/application-dev/reference/arkui-js/js-components-basic-textarea.md
浏览文件 @
08b2da61
...
@@ -95,10 +95,10 @@
...
@@ -95,10 +95,10 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
change
(
e
){
change
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
value:
'
+
e
.
text
+
'
, lines:
'
+
e
.
lines
+
'
, height:
'
+
e
.
height
,
message
:
'
value:
'
+
e
.
text
+
'
, lines:
'
+
e
.
lines
+
'
, height:
'
+
e
.
height
,
duration
:
3000
,
duration
:
3000
,
});
});
...
...
zh-cn/application-dev/reference/arkui-js/js-components-canvas-imagedata.md
浏览文件 @
08b2da61
...
@@ -26,14 +26,14 @@ ImageData对象可以存储canvas渲染的像素数据。
...
@@ -26,14 +26,14 @@ ImageData对象可以存储canvas渲染的像素数据。
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
onShow
()
{
onShow
()
{
const
el
=
this
.
$refs
.
canvas
;
const
el
=
this
.
$refs
.
canvas
;
const
ctx
=
el
.
getContext
(
'
2d
'
);
const
ctx
=
el
.
getContext
(
'
2d
'
);
ctx
.
fillRect
(
0
,
0
,
200
,
200
)
ctx
.
fillRect
(
0
,
0
,
200
,
200
)
var
imageData
=
ctx
.
createImageData
(
1
,
1
)
var
imageData
=
ctx
.
createImageData
(
1
,
1
)
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
imageData
,
message
:
imageData
,
duration
:
5000
duration
:
5000
})
})
...
...
zh-cn/application-dev/reference/arkui-js/js-components-common-methods.md
浏览文件 @
08b2da61
...
@@ -138,7 +138,7 @@ button{
...
@@ -138,7 +138,7 @@ button{
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
data
:{
data
:{
animation
:
''
,
animation
:
''
,
...
@@ -161,19 +161,19 @@ export default{
...
@@ -161,19 +161,19 @@ export default{
this
.
animation
=
this
.
$element
(
'
idName
'
).
animate
(
frames
,
options
);
this
.
animation
=
this
.
$element
(
'
idName
'
).
animate
(
frames
,
options
);
// handle finish event
// handle finish event
this
.
animation
.
onfinish
=
function
(){
this
.
animation
.
onfinish
=
function
(){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
The animation is finished.
"
message
:
"
The animation is finished.
"
});
});
};
};
// handle cancel event
// handle cancel event
this
.
animation
.
oncancel
=
function
(){
this
.
animation
.
oncancel
=
function
(){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
The animation is canceled.
"
message
:
"
The animation is canceled.
"
});
});
};
};
// handle repeat event
// handle repeat event
this
.
animation
.
onrepeat
=
function
(){
this
.
animation
.
onrepeat
=
function
(){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
"
The animation is repeated.
"
message
:
"
The animation is repeated.
"
});
});
};
};
...
...
zh-cn/application-dev/reference/arkui-js/js-components-common-transition.md
浏览文件 @
08b2da61
...
@@ -257,7 +257,7 @@ Page1有一个不透明盒子,点击盒子会跳转到Page2,当点击Page2
...
@@ -257,7 +257,7 @@ Page1有一个不透明盒子,点击盒子会跳转到Page2,当点击Page2
</div>
</div>
```
```
```
cs
s
```
j
s
// xxx.js
// xxx.js
import
router
from
'
@ohos.router
'
;
import
router
from
'
@ohos.router
'
;
export
default
{
export
default
{
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-dialog.md
浏览文件 @
08b2da61
...
@@ -130,30 +130,30 @@
...
@@ -130,30 +130,30 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
showDialog
()
{
showDialog
()
{
this
.
$element
(
'
simpledialog
'
).
show
()
this
.
$element
(
'
simpledialog
'
).
show
()
},
},
cancelDialog
()
{
cancelDialog
()
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
Dialog cancelled
'
message
:
'
Dialog cancelled
'
})
})
},
},
cancelSchedule
()
{
cancelSchedule
()
{
this
.
$element
(
'
simpledialog
'
).
close
()
this
.
$element
(
'
simpledialog
'
).
close
()
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
Successfully cancelled
'
message
:
'
Successfully cancelled
'
})
})
},
},
setSchedule
()
{
setSchedule
()
{
this
.
$element
(
'
simpledialog
'
).
close
()
this
.
$element
(
'
simpledialog
'
).
close
()
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
Successfully confirmed
'
message
:
'
Successfully confirmed
'
})
})
},
},
doubleclick
(){
doubleclick
(){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
doubleclick
'
message
:
'
doubleclick
'
})
})
}
}
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-div.md
浏览文件 @
08b2da61
...
@@ -252,22 +252,22 @@
...
@@ -252,22 +252,22 @@
```
```
```
css
```
css
/* xxx.css */
/* xxx.css */
.container
{
.container
{
flex-direction
:
column
;
flex-direction
:
column
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
.content
{
.content
{
width
:
200px
;
width
:
200px
;
height
:
200px
;
height
:
200px
;
background-color
:
red
;
background-color
:
red
;
}
}
```
```
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
data
:{
data
:{
left
:
0
,
left
:
0
,
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
this
.
top
=
e
.
globalY
;
this
.
top
=
e
.
globalY
;
},
},
dragend
(
e
){
dragend
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
End Drag
'
message
:
'
End Drag
'
})
})
}
}
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
data
:{
data
:{
left
:
0
,
left
:
0
,
...
@@ -331,22 +331,22 @@
...
@@ -331,22 +331,22 @@
this
.
top
=
e
.
globalY
;
this
.
top
=
e
.
globalY
;
},
},
dragenter
(
e
){
dragenter
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
enter
'
message
:
'
enter
'
})
})
},
},
dragover
(
e
){
dragover
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
over
'
message
:
'
over
'
})
})
},
},
dragleave
(
e
){
dragleave
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
leave
'
message
:
'
leave
'
})
})
},
},
drop
(
e
){
drop
(
e
){
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
drop
'
message
:
'
drop
'
})
})
}
}
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-list-item-group.md
浏览文件 @
08b2da61
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
data
:
{
data
:
{
direction
:
'
column
'
,
direction
:
'
column
'
,
...
@@ -157,12 +157,12 @@ export default {
...
@@ -157,12 +157,12 @@ export default {
this
.
$element
(
'
mylist
'
).
expandGroup
()
this
.
$element
(
'
mylist
'
).
expandGroup
()
},
},
collapse
(
e
)
{
collapse
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
Close
'
+
e
.
groupid
message
:
'
Close
'
+
e
.
groupid
})
})
},
},
expand
(
e
)
{
expand
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
Open
'
+
e
.
groupid
message
:
'
Open
'
+
e
.
groupid
})
})
}
}
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-popup.md
浏览文件 @
08b2da61
...
@@ -110,10 +110,10 @@
...
@@ -110,10 +110,10 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
import
prompt
Action
from
'
@ohos.promptAction
'
export
default
{
export
default
{
visibilitychange
(
e
)
{
visibilitychange
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
visibility change visibility:
'
+
e
.
visibility
,
message
:
'
visibility change visibility:
'
+
e
.
visibility
,
duration
:
3000
duration
:
3000
});
});
...
...
zh-cn/application-dev/reference/arkui-js/js-components-container-refresh.md
浏览文件 @
08b2da61
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
```
js
```
js
// xxx.js
// xxx.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
data
:
{
data
:
{
list
:[],
list
:[],
...
@@ -120,7 +120,7 @@ export default {
...
@@ -120,7 +120,7 @@ export default {
}
}
},
},
refresh
:
function
(
e
)
{
refresh
:
function
(
e
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
刷新中...
'
message
:
'
刷新中...
'
})
})
var
that
=
this
;
var
that
=
this
;
...
@@ -129,7 +129,7 @@ export default {
...
@@ -129,7 +129,7 @@ export default {
that
.
fresh
=
false
;
that
.
fresh
=
false
;
var
addItem
=
'
更新元素
'
;
var
addItem
=
'
更新元素
'
;
that
.
list
.
unshift
(
addItem
);
that
.
list
.
unshift
(
addItem
);
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
刷新完成!
'
message
:
'
刷新完成!
'
})
})
},
2000
)
},
2000
)
...
...
zh-cn/application-dev/reference/arkui-js/js-components-grid-col.md
浏览文件 @
08b2da61
...
@@ -92,11 +92,11 @@ grid-col是栅格布局容器grid-row的子容器组件。
...
@@ -92,11 +92,11 @@ grid-col是栅格布局容器grid-row的子容器组件。
```
js
```
js
// index.js
// index.js
import
prompt
from
'
@system.prompt
'
;
import
prompt
Action
from
'
@ohos.promptAction
'
;
export
default
{
export
default
{
getCol
(
e
)
{
getCol
(
e
)
{
this
.
$element
(
'
mygrid
'
).
getColumns
(
function
(
result
)
{
this
.
$element
(
'
mygrid
'
).
getColumns
(
function
(
result
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
e
.
target
.
id
+
'
result =
'
+
result
,
message
:
e
.
target
.
id
+
'
result =
'
+
result
,
duration
:
3000
,
duration
:
3000
,
});
});
...
@@ -104,7 +104,7 @@ export default {
...
@@ -104,7 +104,7 @@ export default {
},
},
getColWidth
(
e
)
{
getColWidth
(
e
)
{
this
.
$element
(
'
mygrid
'
).
getColumnWidth
(
function
(
result
)
{
this
.
$element
(
'
mygrid
'
).
getColumnWidth
(
function
(
result
)
{
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
e
.
target
.
id
+
'
result =
'
+
result
,
message
:
e
.
target
.
id
+
'
result =
'
+
result
,
duration
:
3000
,
duration
:
3000
,
});
});
...
...
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
浏览文件 @
08b2da61
...
@@ -354,6 +354,7 @@ struct ImageExample3 {
...
@@ -354,6 +354,7 @@ struct ImageExample3 {
```
ts
```
ts
import
fileio
from
'
@ohos.fileio
'
import
fileio
from
'
@ohos.fileio
'
import
fs
from
'
@ohos.file.fs
'
;
import
context
from
'
@ohos.application.context
'
import
context
from
'
@ohos.application.context
'
@
Entry
@
Entry
...
@@ -374,7 +375,7 @@ struct LoadImageExample {
...
@@ -374,7 +375,7 @@ struct LoadImageExample {
.
onClick
(()
=>
{
.
onClick
(()
=>
{
this
.
sandboxPath
=
this
.
context
.
getApplicationContext
().
filesDir
+
'
/icon.png
'
this
.
sandboxPath
=
this
.
context
.
getApplicationContext
().
filesDir
+
'
/icon.png
'
console
.
log
(
`读取沙箱图片=========>
${
this
.
sandboxPath
}
`
)
console
.
log
(
`读取沙箱图片=========>
${
this
.
sandboxPath
}
`
)
let
fd
=
f
ileio
.
openSync
(
this
.
sandboxPath
,
0o100
,
0o666
)
let
fd
=
f
s
.
openSync
(
this
.
sandboxPath
,
0o100
)
console
.
log
(
`create file========>
${
fd
}
`
)
console
.
log
(
`create file========>
${
fd
}
`
)
let
srcPath
=
this
.
context
.
bundleCodeDir
+
'
/entry/resources/base/media/icon.png
'
let
srcPath
=
this
.
context
.
bundleCodeDir
+
'
/entry/resources/base/media/icon.png
'
console
.
log
(
'
mySrcpath
'
+
srcPath
)
console
.
log
(
'
mySrcpath
'
+
srcPath
)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md
浏览文件 @
08b2da61
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
```
ts
```
ts
// xxx.ets
// xxx.ets
import
prompt
from
'
@ohos.prompt
'
import
prompt
Action
from
'
@ohos.promptAction
'
@
Entry
@
Entry
@
Component
@
Component
...
@@ -38,14 +38,14 @@ struct AppearExample {
...
@@ -38,14 +38,14 @@ struct AppearExample {
Text
(
this
.
myText
).
fontSize
(
26
).
fontWeight
(
FontWeight
.
Bold
)
Text
(
this
.
myText
).
fontSize
(
26
).
fontWeight
(
FontWeight
.
Bold
)
.
onAppear
(()
=>
{
.
onAppear
(()
=>
{
this
.
changeAppear
=
'
Hide Text
'
this
.
changeAppear
=
'
Hide Text
'
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
The text is shown
'
,
message
:
'
The text is shown
'
,
duration
:
2000
duration
:
2000
})
})
})
})
.
onDisAppear
(()
=>
{
.
onDisAppear
(()
=>
{
this
.
changeAppear
=
'
Show Text
'
this
.
changeAppear
=
'
Show Text
'
prompt
.
showToast
({
prompt
Action
.
showToast
({
message
:
'
The text is hidden
'
,
message
:
'
The text is hidden
'
,
duration
:
2000
duration
:
2000
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录