提交 38178373 编写于 作者: Y yamila

update cherryPickMonthly

Signed-off-by: Nyamila <tianyu55@huawei.com>
上级 aa7d8b16
......@@ -144,7 +144,7 @@ Text(`count: ${this.count}`)
...
Button('add counter')
.onClick(this.myClickHandler)
.onClick(this.myClickHandler.bind(this))
```
### 子组件配置
......
......@@ -223,7 +223,7 @@
.height('5%')
// 跳转按钮绑定onClick事件,点击时跳转到第二页
.onClick(() => {
router.push({ url: 'pages/second' })
router.pushUrl({ url: 'pages/second' })
})
}
.width('100%')
......
......@@ -216,7 +216,7 @@
.height('5%')
// 跳转按钮绑定onClick事件,点击时跳转到第二页
.onClick(() => {
router.push({ url: 'pages/Second' })
router.pushUrl({ url: 'pages/Second' })
})
}
.width('100%')
......
......@@ -125,16 +125,16 @@
```js
// xxx.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
change(e){
prompt.showToast({
promptAction.showToast({
message: "value: " + e.value,
duration: 3000,
});
},
enterkeyClick(e){
prompt.showToast({
promptAction.showToast({
message: "enterkey clicked",
duration: 3000,
});
......@@ -192,10 +192,10 @@
```js
// xxx.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
checkboxOnChange(e) {
prompt.showToast({
promptAction.showToast({
message:'checked: ' + e.checked,
duration: 3000,
});
......@@ -227,11 +227,11 @@
```js
// xxx.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
onRadioChange(inputValue, e) {
if (inputValue === e.value) {
prompt.showToast({
promptAction.showToast({
message: 'The chosen radio is ' + e.value,
duration: 3000,
});
......
......@@ -90,10 +90,10 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
onMenuSelected(e) {
prompt.showToast({
promptAction.showToast({
message: e.value
})
},
......
......@@ -223,8 +223,7 @@ select {
```js
// xxx.js
import router from '@system.router';
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
......@@ -252,63 +251,63 @@ export default {
},
textonchange(e) {
this.textvalue = e.newValue;
prompt.showToast({
promptAction.showToast({
message: "text:" + e.newValue + ",newSelected:" + e.newSelected
})
},
textoncancel(e) {
prompt.showToast({
promptAction.showToast({
message: "text: textoncancel"
})
},
dateonchange(e) {
this.datevalue = e.year + "-" + e.month + "-" + e.day;
prompt.showToast({
promptAction.showToast({
message: "date:" + e.year + "-" + (e.month + 1) + "-" + e.day
})
},
dateoncancel() {
prompt.showToast({
promptAction.showToast({
message: "date: dateoncancel"
})
},
timeonchange(e) {
if (this.containsecond) {
this.timevalue = e.hour + ":" + e.minute + ":" + e.second;
prompt.showToast({
promptAction.showToast({
message: "Time:" + e.hour + ":" + e.minute + ":" + e.second
})
} else {
this.timevalue = e.hour + ":" + e.minute;
prompt.showToast({
promptAction.showToast({
message: "Time:" + e.hour + ":" + e.minute
})
}
},
timeoncancel() {
prompt.showToast({
promptAction.showToast({
message: "timeoncancel"
})
},
datetimeonchange(e) {
this.datetimevalue = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute;
prompt.showToast({
promptAction.showToast({
message: "Time:" + (e.month + 1) + "-" + e.day + " " + e.hour + ":" + e.minute
})
},
datetimeoncancel() {
prompt.showToast({
promptAction.showToast({
message: "datetimeoncancel"
})
},
multitextonchange(e) {
this.multitextvalue = e.newValue;
prompt.showToast({
promptAction.showToast({
message: "Multi-column text change" + e.newValue
})
},
multitextoncancel() {
prompt.showToast({
promptAction.showToast({
message: "multitextoncancel"
})
},
......
......@@ -83,10 +83,10 @@ rating {
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
changeRating(e){
prompt.showToast({
promptAction.showToast({
message: e.rating
});
}
......
......@@ -91,7 +91,7 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
title: 'World'
......@@ -109,11 +109,11 @@ export default {
},
normalswitchChange(e) {
if (e.checked) {
prompt.showToast({
promptAction.showToast({
message: "switch on"
});
} else {
prompt.showToast({
promptAction.showToast({
message: "switch off"
});
}
......
......@@ -95,10 +95,10 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
change(e){
prompt.showToast({
promptAction.showToast({
message: 'value: ' + e.text + ', lines: ' + e.lines + ', height: ' + e.height,
duration: 3000,
});
......
......@@ -26,14 +26,14 @@ ImageData对象可以存储canvas渲染的像素数据。
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
onShow() {
const el =this.$refs.canvas;
const ctx = el.getContext('2d');
ctx.fillRect(0,0,200,200)
var imageData = ctx.createImageData(1,1)
prompt.showToast({
promptAction.showToast({
message:imageData,
duration:5000
})
......
......@@ -138,7 +138,7 @@ button{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default{
data:{
animation:'',
......@@ -161,19 +161,19 @@ export default{
this.animation = this.$element('idName').animate(frames, options);
// handle finish event
this.animation.onfinish = function(){
prompt.showToast({
promptAction.showToast({
message: "The animation is finished."
});
};
// handle cancel event
this.animation.oncancel = function(){
prompt.showToast({
promptAction.showToast({
message: "The animation is canceled."
});
};
// handle repeat event
this.animation.onrepeat = function(){
prompt.showToast({
promptAction.showToast({
message: "The animation is repeated."
});
};
......
......@@ -257,7 +257,7 @@ Page1有一个不透明盒子,点击盒子会跳转到Page2,当点击Page2
</div>
```
```css
```js
// xxx.js
import router from '@ohos.router';
export default {
......
......@@ -130,30 +130,30 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
showDialog() {
this.$element('simpledialog').show()
},
cancelDialog() {
prompt.showToast({
promptAction.showToast({
message: 'Dialog cancelled'
})
},
cancelSchedule() {
this.$element('simpledialog').close()
prompt.showToast({
promptAction.showToast({
message: 'Successfully cancelled'
})
},
setSchedule() {
this.$element('simpledialog').close()
prompt.showToast({
promptAction.showToast({
message: 'Successfully confirmed'
})
},
doubleclick(){
prompt.showToast({
promptAction.showToast({
message: 'doubleclick'
})
}
......
......@@ -252,29 +252,29 @@
```
```css
/* xxx.css */
.container {
/* xxx.css */
.container {
flex-direction: column;
width: 100%;
height: 100%;
}
.content {
}
.content {
width: 200px;
height: 200px;
background-color: red;
}
}
```
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
left:0,
top:0,
},
dragstart(e){
prompt.showToast({
promptAction.showToast({
message: 'Start to be dragged'
})
},
......@@ -283,7 +283,7 @@
this.top = e.globalY;
},
dragend(e){
prompt.showToast({
promptAction.showToast({
message: 'End Drag'
})
}
......@@ -320,7 +320,7 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
left:0,
......@@ -331,22 +331,22 @@
this.top = e.globalY;
},
dragenter(e){
prompt.showToast({
promptAction.showToast({
message: 'enter'
})
},
dragover(e){
prompt.showToast({
promptAction.showToast({
message: 'over'
})
},
dragleave(e){
prompt.showToast({
promptAction.showToast({
message: 'leave'
})
},
drop(e){
prompt.showToast({
promptAction.showToast({
message: 'drop'
})
}
......@@ -384,25 +384,25 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
pinchstart(e){
prompt.showToast({
promptAction.showToast({
message: 'pinchstart!!!'
})
},
pinchupdate(e){
prompt.showToast({
promptAction.showToast({
message: 'Two-finger pinch update'
})
},
pinchend(e){
prompt.showToast({
promptAction.showToast({
message: 'Finished with two fingers pinching'
})
},
pinchcancel(e){
prompt.showToast({
promptAction.showToast({
message: 'Finger pinching is interrupted'
})
}
......
......@@ -123,7 +123,7 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
direction: 'column',
......@@ -157,12 +157,12 @@ export default {
this.$element('mylist').expandGroup()
},
collapse(e) {
prompt.showToast({
promptAction.showToast({
message: 'Close ' + e.groupid
})
},
expand(e) {
prompt.showToast({
promptAction.showToast({
message: 'Open ' + e.groupid
})
}
......
......@@ -110,10 +110,10 @@
```js
// xxx.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
visibilitychange(e) {
prompt.showToast({
promptAction.showToast({
message: 'visibility change visibility: ' + e.visibility,
duration: 3000
});
......
......@@ -106,7 +106,7 @@
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
list:[],
......@@ -120,7 +120,7 @@ export default {
}
},
refresh: function (e) {
prompt.showToast({
promptAction.showToast({
message: '刷新中...'
})
var that = this;
......@@ -129,7 +129,7 @@ export default {
that.fresh = false;
var addItem = '更新元素';
that.list.unshift(addItem);
prompt.showToast({
promptAction.showToast({
message: '刷新完成!'
})
}, 2000)
......
......@@ -92,11 +92,11 @@ grid-col是栅格布局容器grid-row的子容器组件。
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
getCol(e) {
this.$element('mygrid').getColumns(function (result) {
prompt.showToast({
promptAction.showToast({
message: e.target.id + ' result = ' + result,
duration: 3000,
});
......@@ -104,7 +104,7 @@ export default {
},
getColWidth(e) {
this.$element('mygrid').getColumnWidth(function (result) {
prompt.showToast({
promptAction.showToast({
message: e.target.id + ' result = ' + result,
duration: 3000,
});
......
......@@ -354,6 +354,7 @@ struct ImageExample3 {
```ts
import fileio from '@ohos.fileio'
import fs from '@ohos.file.fs'
import context from '@ohos.application.context'
@Entry
......@@ -374,7 +375,7 @@ struct LoadImageExample {
.onClick(() => {
this.sandboxPath = this.context.getApplicationContext().filesDir + '/icon.png'
console.log(`读取沙箱图片=========>${this.sandboxPath}`)
let fd = fileio.openSync(this.sandboxPath, 0o100, 0o666)
let fd = fs.openSync(this.sandboxPath, 0o100)
console.log(`create file========>${fd}`)
let srcPath = this.context.bundleCodeDir + '/entry/resources/base/media/icon.png'
console.log('mySrcpath' + srcPath)
......
......@@ -19,7 +19,7 @@
```ts
// xxx.ets
import prompt from '@ohos.prompt'
import promptAction from '@ohos.promptAction'
@Entry
@Component
......@@ -38,14 +38,14 @@ struct AppearExample {
Text(this.myText).fontSize(26).fontWeight(FontWeight.Bold)
.onAppear(() => {
this.changeAppear = 'Hide Text'
prompt.showToast({
promptAction.showToast({
message: 'The text is shown',
duration: 2000
})
})
.onDisAppear(() => {
this.changeAppear = 'Show Text'
prompt.showToast({
promptAction.showToast({
message: 'The text is hidden',
duration: 2000
})
......
......@@ -45,10 +45,10 @@
**res-defaults.json示例:**<br/>
```
```json
{
strings: {
hello: 'hello world'
"strings": {
"hello": "hello world"
}
}
```
......@@ -57,7 +57,7 @@
resources/res-dark.json:
```
```json
{
"image": {
"clockFace": "common/dark_face.png"
......@@ -70,7 +70,7 @@ resources/res-dark.json:
resources/res-defaults.json:
```
```json
{
"image": {
"clockFace": "common/face.png"
......@@ -81,7 +81,7 @@ resources/res-defaults.json:
}
```
```
```html
<!-- xxx.hml -->
<div style="background-color: {{ $r('colors.background') }}">
<image src="{{ $r('image.clockFace') }}"></image>
......
......@@ -11,7 +11,7 @@ JS文件用来定义HML页面的业务逻辑,支持ECMA规范的JavaScript语
使用import方法引入功能模块:
```js
import router from '@system.router';
import router from '@ohos.router';
```
- 代码引用
......
......@@ -388,7 +388,7 @@ button{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
animation: '',
......@@ -427,17 +427,17 @@ export default {
];
this.animation = this.$element('content').animate(frames, options);
this.animation.onstart = function(){
prompt.showToast({
promptAction.showToast({
message: "start"
});
};
this.animation.onrepeat = function(){
prompt.showToast({
promptAction.showToast({
message: " repeated"
});
};
this.animation.onfinish = function(){
prompt.showToast({
promptAction.showToast({
message: " finished"
});
};
......
......@@ -48,7 +48,6 @@ index和detail这两个页面均包含一个text组件和button组件:text组
justify-content: center;
align-items: center;
}
.title {
font-size: 50px;
margin-bottom: 50px;
......
......@@ -181,10 +181,10 @@ tabs默认展示索引为index的标签及内容。通过设置vertical属性使
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
tabChange(e){
prompt.showToast({
promptAction.showToast({
message: "Tab index: " + e.index
})
}
......@@ -271,7 +271,6 @@ background-color:#F1F3F5;
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data() {
return {
......
......@@ -81,7 +81,7 @@ button是按钮组件,其类型包括胶囊按钮、圆形按钮、文本按
如果需要添加ohos.permission.INTERNET权限,则在resources文件夹下的config.json文件里进行权限配置。
```
```json
<!-- config.json -->
"module": {
"reqPermissions": [{
......@@ -121,7 +121,7 @@ button是按钮组件,其类型包括胶囊按钮、圆形按钮、文本按
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
percent: 0,
......@@ -135,7 +135,7 @@ export default {
this.percent += 1;
this.downloadText = this.percent+ "%";
} else{
prompt.showToast({
promptAction.showToast({
message: "Download succeeded."
})
this.paused()
......@@ -151,13 +151,13 @@ export default {
},
setProgress(e) {
if(this.isPaused){
prompt.showToast({
promptAction.showToast({
message: "Started Downloading"
})
this.start();
this.isPaused = false;
}else{
prompt.showToast({
promptAction.showToast({
message: "Paused."
})
this.paused();
......
......@@ -9,7 +9,7 @@ Canvas组件提供画布,用于自定义绘制图形。具体用法请参考[C
在pages/index目录下的hml文件中创建一个Canvas组件。
```
```html
<!-- xxx.hml -->
<div class="container">
<canvas></canvas>
......@@ -116,7 +116,7 @@ Canvas添加长按事件,长按后可获取Canvas组件的dataUrl值(toDataU
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
dataURL:null,
......@@ -130,7 +130,7 @@ export default {
let el = this.$refs.canvas1
let dataUrl = el.toDataURL()
this.dataURL = dataUrl;
prompt.showToast({duration:2000,message:"long press,get dataURL"})
promptAction.showToast({duration:2000,message:"long press,get dataURL"})
}
}
```
......
......@@ -51,7 +51,6 @@ select{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
el: null,
......@@ -254,7 +253,6 @@ select{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
el: null,
......@@ -352,7 +350,6 @@ select{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
el: null,
......@@ -478,7 +475,6 @@ select{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
el: null,
......@@ -635,7 +631,7 @@ text{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
compositeOperation: 'source-over'
......@@ -678,7 +674,7 @@ export default {
};
// 图片获取失败触发方法
img1.onerror = function() {
prompt.showToast({message:"error",duration:2000})
promptAction.showToast({message:"error",duration:2000})
};
},
rotate(){
......@@ -805,7 +801,7 @@ text{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
ctx: '',
......@@ -818,7 +814,7 @@ export default {
save(){
// 画笔储存
this.ctx.save();
prompt.showToast({message:"save succeed"});
promptAction.showToast({message:"save succeed"});
},
clear(){
this.ctx.clearRect(0,0,600,500);
......
......@@ -119,22 +119,22 @@ button{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
canceldialog(e){
prompt.showToast({
promptAction.showToast({
message: 'dialogCancel'
})
},
opendialog(){
this.$element('dialogId').show()
prompt.showToast({
promptAction.showToast({
message: 'dialogShow'
})
},
confirmClick(e) {
this.$element('dialogId').close()
prompt.showToast({
promptAction.showToast({
message: 'dialogClose'
})
},
......@@ -266,8 +266,8 @@ export default {
```js
// xxx.js
var info = null;
import prompt from '@system.prompt';
import router from '@system.router';
import promptAction from '@ohos.promptAction';
export default {
data: {
curYear:'',
......@@ -290,7 +290,7 @@ export default {
this.$element('datedialog').show()
},
canceldialog(e) {
prompt.showToast({
promptAction.showToast({
message: 'Event setting canceled.'
})
},
......@@ -299,7 +299,7 @@ export default {
},
cancelschedule(e) {
this.$element('datedialog').close()
prompt.showToast({
promptAction.showToast({
message: 'Event setting canceled.'
})
},
......
......@@ -120,15 +120,15 @@ form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default{
onSubmit(result) {
prompt.showToast({
promptAction.showToast({
message: result.value.radioGroup
})
},
onReset() {
prompt.showToast({
promptAction.showToast({
message: 'Reset All'
})
}
......@@ -201,15 +201,15 @@ label{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
formSubmit() {
prompt.showToast({
promptAction.showToast({
message: 'Submitted.'
})
},
formReset() {
prompt.showToast({
promptAction.showToast({
message: 'Reset.'
})
}
......
......@@ -77,7 +77,7 @@ grid-container点击组件调用getColumns、getColumnWidth、getGutterWidth方
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
gutterWidth:'',
......@@ -95,13 +95,13 @@ export default {
this.columns= result;
})
setTimeout(()=>{
prompt.showToast({duration:5000,message:'columnWidth:'+this.columnWidth+',gutterWidth:'+
promptAction.showToast({duration:5000,message:'columnWidth:'+this.columnWidth+',gutterWidth:'+
this.gutterWidth+',getColumns:'+this.columns})
})
},
getSizeType(){
this.$element('mygrid').getSizeType((result)=>{
prompt.showToast({duration:2000,message:'get size type:'+result})
promptAction.showToast({duration:2000,message:'get size type:'+result})
})
},
}
......@@ -217,7 +217,7 @@ text{
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
list:[
......@@ -228,7 +228,7 @@ export default {
fresh:false
},
refresh(e) {
prompt.showToast({
promptAction.showToast({
message: 'refreshing'
})
var that = this;
......@@ -236,7 +236,7 @@ export default {
setTimeout(function () {
that.fresh = false;
that.list.unshift({src: 'common/images/4.png',id:'4'});
prompt.showToast({
promptAction.showToast({
message: 'succeed'
})
}, 2000)
......
......@@ -177,7 +177,7 @@ export default {
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
imginfo: [
......@@ -201,22 +201,22 @@ export default {
this.$element('img').resume()
},
popstart(e) {
prompt.showToast({
promptAction.showToast({
message: '开始'
})
},
poppause(e) {
prompt.showToast({
promptAction.showToast({
message: '暂停'
})
},
popstop(e) {
prompt.showToast({
promptAction.showToast({
message: '停止'
})
},
popresume(e) {
prompt.showToast({
promptAction.showToast({
message: '恢复'
})
}
......@@ -285,7 +285,7 @@ button{
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
rev:false,
......@@ -317,7 +317,7 @@ export default {
this.$element('img').resume()
},
getimgstate(e) {
prompt.showToast({
promptAction.showToast({
message: '当前状态:' + this.$element('img').getState()
})
},
......
......@@ -101,17 +101,17 @@ image{
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
imageComplete(i,e){
prompt.showToast({
promptAction.showToast({
message: "image "+i+"'s width"+ e.width+"----image "+i+"'s height"+e.height,
duration: 3000,
})
},
imageError(i,e){
setTimeout(()=>{
prompt.showToast({
promptAction.showToast({
message: "Failed to load image "+i+".",
duration: 3000,
})
......@@ -177,7 +177,7 @@ export default {
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
testuri: 'common/images/bg-tv.jpg',
......@@ -185,7 +185,7 @@ export default {
timer: null
},
changeopacity: function () {
prompt.showToast({
promptAction.showToast({
message: 'Touch and hold the image.'
})
var opval = this.imageopacity * 20
......
......@@ -145,16 +145,16 @@ text{
```js
// xxx.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
search(e){
prompt.showToast({
promptAction.showToast({
message: e.value,
duration: 3000,
});
},
translate(e){
prompt.showToast({
promptAction.showToast({
message: e.value,
duration: 3000,
});
......@@ -200,14 +200,14 @@ export default {
```js
// xxx.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
data:{
value:'',
},
change(e){
this.value = e.value;
prompt.showToast({
promptAction.showToast({
message: "value: " + this.value,
duration: 3000,
});
......@@ -222,7 +222,7 @@ import prompt from '@system.prompt'
error:this.value + 'This field cannot be left empty.'
});
}else{
prompt.showToast({
promptAction.showToast({
message: "success "
});
}
......@@ -302,14 +302,14 @@ label {
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
},
onInit() {
},
btnclick(e) {
prompt.showToast({
promptAction.showToast({
message:'Saved successfully!'
})
}
......
......@@ -162,7 +162,7 @@ margin-top:30px;
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
direction: 'column',
......@@ -179,12 +179,12 @@ export default {
}
},
collapse(e) {
prompt.showToast({
promptAction.showToast({
message: 'Close ' + e.groupid
})
},
expand(e) {
prompt.showToast({
promptAction.showToast({
message: 'Open ' + e.groupid
})
}
......
......@@ -150,15 +150,15 @@ option{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
select(e) {
prompt.showToast({
promptAction.showToast({
message: e.value
})
},
cancel(){
prompt.showToast({
promptAction.showToast({
message: "cancel"
})
},
......@@ -242,7 +242,6 @@ option{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
fresh: false,
......
......@@ -49,7 +49,7 @@ select{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
el: null,
......@@ -70,7 +70,7 @@ export default {
_this.offCanvas.drawImage(_this.img, 100, 100, 400, 300);
};
this.img.onerror = function() {
prompt.showToast({message:"error",duration:2000})
promptAction.showToast({message:"error",duration:2000})
};
var bitmap = this.offscreen.transferToImageBitmap(); this.ctx.transferFromImageBitmap(bitmap);
},
......
......@@ -36,8 +36,6 @@ canvas {
```js
// xxx.js
import prompt from '@system.prompt';
export default {
onShow() {
let ctx = this.$refs.canvas.getContext('2d', {
......@@ -139,8 +137,6 @@ text {
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data: {
ctx: null,
......
......@@ -144,7 +144,7 @@ picker的hours属性定义时间的展现格式,可选类型有12小时制和2
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"]],
......@@ -153,10 +153,10 @@ export default {
},
multitextonchange(e) {
this.multitextvalue=e.newValue;
prompt.showToast({ message:"Multi-column text changed to:" + e.newValue })
promptAction.showToast({ message:"Multi-column text changed to:" + e.newValue })
},
multitextoncancel() {
prompt.showToast({ message:"multitextoncancel" })
promptAction.showToast({ message:"multitextoncancel" })
},
}
```
......@@ -246,7 +246,7 @@ export default {
```js
// xxx.js
import pmt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
data: {
yorn1:'No',
......@@ -281,10 +281,10 @@ export default {
dateonchange(e) {
e.month=e.month+1;
this.datevalue = e.year + "-" + e.month + "-" + e.day;
pmt.showToast({ message:"date:"+e.year+"-"+e.month+"-"+e.day })
promptAction.showToast({ message:"date:"+e.year+"-"+e.month+"-"+e.day })
},
showtoast() {
pmt.showToast({
promptAction.showToast({
message: 'Submitted.',
duration: 2000,
gravity: 'center'
......
......@@ -154,10 +154,10 @@ rating {
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
showrating(e) {
prompt.showToast({
promptAction.showToast({
message: '当前评分' + e.rating
})
}
......@@ -213,7 +213,7 @@ switch{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
backstar: '',
......@@ -249,7 +249,7 @@ export default {
this.rate = e.progress
},
showrating(e) {
prompt.showToast({
promptAction.showToast({
message: '当前评分' + e.rating
})
}
......
......@@ -132,34 +132,34 @@ text{
```js
// index.js
import prompt from '@system.prompt'
import promptAction from '@ohos.promptAction'
export default {
search(e){
prompt.showToast({
promptAction.showToast({
message: e.value,
duration: 3000,
});
},
translate(e){
prompt.showToast({
promptAction.showToast({
message: e.value,
duration: 3000,
});
},
share(e){
prompt.showToast({
promptAction.showToast({
message: e.value,
duration: 3000,
});
},
change(e){
prompt.showToast({
promptAction.showToast({
message: e.value,
duration: 3000,
});
},
submit(e){
prompt.showToast({
promptAction.showToast({
message: 'submit',
duration: 3000,
});
......@@ -218,7 +218,7 @@ export default {
```js
// index.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
showsearch: true,
......@@ -243,13 +243,13 @@ export default {
}
},
submit(e) {
prompt.showToast({
promptAction.showToast({
message: '搜索!',
duration: 2000
})
},
change(e) {
prompt.showToast({
promptAction.showToast({
message: '内容:' + e.text,
duration: 2000
})
......
......@@ -248,7 +248,7 @@ button{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data: {
index:0,
......@@ -261,20 +261,20 @@ export default {
this.$element('stepperId').setNextButtonStatus({status: 'skip', label: 'SKIP'});
},
stepperFinish(){
prompt.showToast({
promptAction.showToast({
message: 'All Finished'
})
},
stepperChange(e){
console.log("stepperChange"+e.index)
prompt.showToast({
promptAction.showToast({
// index表示当前步骤的序号
message: 'Previous step: '+e.prevIndex+"-------Current step:"+e.index
})
},
stepperNext(e){
console.log("stepperNext"+e.index)
prompt.showToast({
promptAction.showToast({
// pendingIndex表示将要跳转的序号
message: 'Current step:'+e.index+"-------Next step:"+e.pendingIndex
})
......@@ -363,8 +363,6 @@ export default {
```js
// xxx.js
import prompt from '@system.prompt';
import router from '@system.router';
let myset = new Set();
export default {
data: {
......
......@@ -261,13 +261,13 @@ select{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default{
change(e){
prompt.showToast({duration:2000,message:"current index:"+e.index});
promptAction.showToast({duration:2000,message:"current index:"+e.index});
},
finish(){
prompt.showToast({duration:2000,message:"切换动作结束"});
promptAction.showToast({duration:2000,message:"切换动作结束"});
},
selectChange(e){
this.$element('swiper').swipeTo({index: Number(e.newValue)});
......@@ -343,7 +343,6 @@ swiper{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
index: 0,
......
......@@ -61,15 +61,15 @@ switch {
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
switchChange(e){
if(e.checked){
prompt.showToast({
promptAction.showToast({
message: "open"
});
}else{
prompt.showToast({
promptAction.showToast({
message: "close"
});
}
......@@ -167,7 +167,6 @@ switch{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
address: '',
......
......@@ -153,17 +153,17 @@ toolbar-item{
```js
// xxx.js
import prompt from '@system.prompt';
import promptAction from '@ohos.promptAction';
export default {
data:{
itemColor:'black'
},
itemClick(){
this.itemColor= "red";
prompt.showToast({duration:2000,message:'item click'});
promptAction.showToast({duration:2000,message:'item click'});
},
itemLongPress(){
prompt.showToast({duration:2000,message:'item long press'});
promptAction.showToast({duration:2000,message:'item long press'});
this.itemColor= "blue";
},
}
......@@ -210,7 +210,6 @@ toolbar-item{
```js
// xxx.js
import prompt from '@system.prompt';
export default {
data:{
active: 0,
......
......@@ -137,7 +137,7 @@
delay: 100,
onFinish: () => {
setTimeout(() => {
router.replace({ url: "pages/FoodCategoryList" })
router.replaceUrl({ url: "pages/FoodCategoryList" })
}, 1000);
}
}, () => {
......@@ -201,7 +201,7 @@
delay: 100,
onFinish: () => {
setTimeout(() => {
router.replace({ url: "pages/FoodCategoryList" })
router.replaceUrl({ url: "pages/FoodCategoryList" })
}, 1000);
}
}, () => {
......@@ -305,7 +305,7 @@
.height(184)
.width('100%')
.onClick(() => {
router.push({ url: 'pages/FoodDetail', params: { foodData: this.foodItem } })
router.pushUrl({ url: 'pages/FoodDetail', params: { foodData: this.foodItem } })
})
}
}
......
......@@ -61,7 +61,7 @@
.height(184)
.width('100%')
.onClick(() => {
router.push({ url: 'pages/FoodDetail' })
router.pushUrl({ url: 'pages/FoodDetail' })
})
}
}
......@@ -138,7 +138,7 @@
FoodGridItem调用的routerAPI同样有携带参数跳转的能力,使用方法和Navigator类似。
```ts
router.push({
router.pushUrl({
url: 'pages/FoodDetail',
params: { foodData: this.foodItem }
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册