当前位置:网站首页>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 .
边栏推荐
- [groovy] string (string splicing | multi line string)
- About the recent experience of writing questions
- Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
- 线程基础知识
- Containerization Foundation
- An elegant program for Euclid‘s algorithm
- Deep learning - LSTM Foundation
- [positioning in JS]
- error Couldn‘t find a package.json file in “你的路径“
- C语言课设:影院售票管理系统
猜你喜欢
Rust区块琏开发——签名加密与私钥公钥
【web审计-源码泄露】获取源码方法,利用工具
[wp]bmzclub几道题的writeup
Redis6-01nosql database
[C language] address book - dynamic and static implementation
De debugging (set the main thread as hidden debugging to destroy the debugging Channel & debugger detection)
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
[vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
Pyqt5 displays file names and pictures
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
随机推荐
反絮凝剂-氨碘肽滴眼液
speed or tempo in classical music
Official announcement! The third cloud native programming challenge is officially launched!
speed or tempo in classical music
测试开发是什么?为什么现在那么多公司都要招聘测试开发?
Containerd series - detailed explanation of plugins
【无标题】
【web审计-源码泄露】获取源码方法,利用工具
It took two nights to get Wu Enda's machine learning course certificate from Stanford University
NEW:Devart dotConnect ADO.NET
【刷题】BFS题目精选
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
Clickhouse synchronization MySQL (based on materialization engine)
This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
【web審計-源碼泄露】獲取源碼方法,利用工具
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
[punch in questions] integrated daily 5-question sharing (phase III)
汇编-入门
v-if VS v-show 2.0
grandMA2 onPC 3.1.2.5的DMX参数摸索