当前位置:网站首页>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 .
边栏推荐
- How about programmers' eyesight| Daily anecdotes
- Clickhouse同步mysql(基于物化引擎)
- 天干地支纪年法中为什么是60年一个轮回,而不是120年
- UI自動化測試從此告別手動下載瀏覽器驅動
- 一文带你了解BI的前世今身与企业数字化转型的关系
- [positioning in JS]
- speed or tempo in classical music
- Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
- 输入的查询SQL语句,是如何执行的?
- Containerd series - what is containerd?
猜你喜欢

About the recent experience of writing questions

Zero foundation uses paddlepaddle to build lenet-5 network

特殊版:SpreadJS v15.1 VS SpreadJS v15.0

程序员的视力怎么样? | 每日趣闻

CTF stegano practice stegano 9

MindFusion. Virtual Keyboard for WPF

Smart pointer shared_ PTR and weak_ Difference of PTR

【web審計-源碼泄露】獲取源碼方法,利用工具

【软件逆向-分析工具】反汇编和反编译工具
![[software reverse - basic knowledge] analysis method, assembly instruction architecture](/img/97/8001db1c572495a115d32d9dd7360e.png)
[software reverse - basic knowledge] analysis method, assembly instruction architecture
随机推荐
NEW:Devart dotConnect ADO.NET
【看完就懂系列】一文6000字教你从0到1实现接口自动化
Subversive cognition: what does SRE do?
Difference between MotionEvent. getRawX and MotionEvent. getX
[wp]bmzclub几道题的writeup
DECLARE_ WAIT_ QUEUE_ HEAD、wake_ up_ Interruptible macro analysis
[brush questions] BFS topic selection
[vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
【web源码-代码审计方法】审计技巧及审计工具
优先使用对象组合,而不是类继承
【web审计-源码泄露】获取源码方法,利用工具
As soon as I write the code, President Wang talks with me about the pattern all day
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Excuse me, my request is a condition update, but it is blocked in the buffer. In this case, can I only flush the cache every time?
[web Audit - source code disclosure] obtain source code methods and use tools
A brief introduction to the behavior tree of unity AI
汇编-入门
Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
Learning notes of raspberry pie 4B - IO communication (I2C)
UI自动化测试从此告别手动下载浏览器驱动
