当前位置:网站首页>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 .
边栏推荐
- CTF stegano practice stegano 9
- [vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
- Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
- Necessary fonts for designers
- Enterprise level: spire Office for . NET:Platinum|7.7. x
- [move pictures up, down, left and right through the keyboard in JS]
- C # use awaiter
- As soon as I write the code, President Wang talks with me about the pattern all day
- error Couldn‘t find a package. JSON file in "your path“
- [web Audit - source code disclosure] obtain source code methods and use tools
猜你喜欢
[wp][入门]刷弱类型题目
Some enterprise interview questions of unity interview
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Quick start of UI component development of phantom engine [umg/slate]
Subversive cognition: what does SRE do?
一文带你了解BI的前世今身与企业数字化转型的关系
Clickhouse物化视图
【看完就懂系列】一文6000字教你从0到1实现接口自动化
[安洵杯 2019]不是文件上传
Timing manager based on C #
随机推荐
深度学习——LSTM基础
NEW:Devart dotConnect ADO.NET
C语言课设:影院售票管理系统
函数基础学习02
Solve the problem that sqlyog does not have a schema Designer
De debugging (set the main thread as hidden debugging to destroy the debugging Channel & debugger detection)
Anti debugging (basic principles of debugger Design & NT NP and other anti debugging principles)
This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
provide/inject
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
KVM virtualization
Some enterprise interview questions of unity interview
Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant
English essential vocabulary 3400
Thread Basics
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
[software reverse analysis tool] disassembly and decompilation tool
About authentication services (front and back, login, registration and exit, permission management)
How to use jedis of redis