当前位置:网站首页>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 .
边栏推荐
- [summary of two registration methods]
- Basic knowledge of tuples
- provide/inject
- Nmap使用手册学习记录
- 一文带你了解BI的前世今身与企业数字化转型的关系
- 英语必备词汇3400
- [software reverse - basic knowledge] analysis method, assembly instruction architecture
- Solve the problem that sqlyog does not have a schema Designer
- On the day 25K joined Tencent, I cried
- Containerization Foundation
猜你喜欢

Basic function learning 02

Clickhouse物化视图

Clickhouse synchronization MySQL (based on materialization engine)

PlasticSCM 企业版Crack

IronXL for . NET 2022.6

已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘

Redis之Jedis如何使用

一文带你了解BI的前世今身与企业数字化转型的关系

Plasticscm enterprise crack

花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
随机推荐
What is test development? Why do so many companies hire test developers now?
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
MySQL winter vacation self-study 2022 11 (10)
JVM garbage collection
Clickhouse物化视图
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
线程基础知识
【看完就懂系列】一文6000字教你从0到1实现接口自动化
[an Xun cup 2019] not file upload
企业级:Spire.Office for .NET:Platinum|7.7.x
【软件逆向-分析工具】反汇编和反编译工具
[数组]566. 重塑矩阵-简单
English essential vocabulary 3400
Containerd series - what is containerd?
Use of vscode software
UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
v-if VS v-show 2.0
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
ClickPaaS低代码平台
【软件逆向-基础知识】分析方法、汇编指令体系结构
