当前位置:网站首页>Uni app common functions /api
Uni app common functions /api
2022-07-05 03:56:00 【Chu Junjun】
(1)@tap="": Event triggered by finger click
(2)setTimeout: Set a timer , Execute the registered callback function after the timer expires
(3)uni.showToast: When we need to pop up the prompt box , You can use this function
methods: {
toshow() {
uni.showToast({
title: ' Jump out prompt ',
icon: "error"
});
}
effect :
(4)uni.showModal: Show modal pop ups , There can be only one OK button , You can also have both OK and Cancel buttons
methods: {
uni.showModal({
title:' Warning ',
content:' I am a bullet box ',
success: function (res) {
if(res.confirm) {
console.log(' I clicked the OK button ');
} else if (res.cancel) {
console.log(' I clicked the Cancel button ')
}
}
})
}
}
effect :
(5)uni.showActionSheet: Pop up the operation menu from the bottom
(6)setTimer: When you need to perform something at regular intervals, you need to use SetTimer function
(7)setInterval:setInterval() It's a function that can be called regularly , According to the specified period ( In milliseconds ) To call a function or evaluate an expression . Methods will call functions all the time , until clearInterval Called or window closed .
setTimer(){
let holdTime = 60; // Define variables and assign values
this.getCodeText = " Recapture (60)"
//setInterval() It's a function that can be called regularly , According to the specified period ( In milliseconds ) To call a function or evaluate an expression .
//setInterval Methods will call functions all the time , until clearInterval Called or window closed .
this.Timer = setInterval(()=>{
if(holdTime<=0){
this.getCodeisWaiting = false;
this.getCodeBtnColor = "#ffffff";
this.getCodeText = " Get verification code "
clearInterval(this.Timer);// Clear this function
return ; // Back to front
}
this.getCodeText = " Recapture ("+holdTime+")"
holdTime--;
},1000)
},
(8)clearInterval: Cancel from setInterval Set the timer .
(9)uni.hideKeyboard:() Hide the soft keyboard
(10)uni.showLoading: Show loading Prompt box , It is necessary to call uni.hideLoading To close the prompt box .
边栏推荐
- What is test development? Why do so many companies hire test developers now?
- UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
- Clickhouse synchronization MySQL (based on materialization engine)
- glibc strlen 实现方式分析
- Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
- UI自动化测试从此告别手动下载浏览器驱动
- Analysis of dagger2 principle
- [数组]566. 重塑矩阵-简单
- @Transactional 注解导致跨库查询失效的问题
- Subversive cognition: what does SRE do?
猜你喜欢
Redis6-01nosql database
laravel8 导出Excle文件
v-if VS v-show 2.0
【web源码-代码审计方法】审计技巧及审计工具
[an Xun cup 2019] not file upload
An elegant program for Euclid‘s algorithm
Special Edition: spreadjs v15.1 vs spreadjs v15.0
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
Official announcement! The third cloud native programming challenge is officially launched!
【刷题】BFS题目精选
随机推荐
NPM introduction link symbolic link
As soon as I write the code, President Wang talks with me about the pattern all day
【软件逆向-基础知识】分析方法、汇编指令体系结构
【web審計-源碼泄露】獲取源碼方法,利用工具
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
请问一下我的请求是条件更新,但在buffer中就被拦截了,这种情况我只能每次去flush缓存么?
UI自动化测试从此告别手动下载浏览器驱动
[PHP features - variable coverage] improper use, improper configuration and code logic vulnerability of the function
Analysis of dagger2 principle
Technology sharing swift defense programming
优先使用对象组合,而不是类继承
Difference between MotionEvent. getRawX and MotionEvent. getX
天干地支纪年法中为什么是60年一个轮回,而不是120年
Zero foundation uses paddlepaddle to build lenet-5 network
企业级:Spire.Office for .NET:Platinum|7.7.x
[wp][入门]刷弱类型题目
Analysis of glibc strlen implementation mode
深度学习——LSTM基础
The architect started to write a HelloWorld
error Couldn‘t find a package.json file in “你的路径“