当前位置:网站首页>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] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
- Redis6-01nosql database
- Timing manager based on C #
- Pyqt5 displays file names and pictures
- 【做题打卡】集成每日5题分享(第三期)
- error Couldn‘t find a package.json file in “你的路径“
- [groovy] string (string type variable definition | character type variable definition)
- NEW:Devart dotConnect ADO.NET
- Analysis of dagger2 principle
- UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
猜你喜欢
【软件逆向-基础知识】分析方法、汇编指令体系结构
[wp][introduction] brush weak type questions
Use of vscode software
IronXL for .NET 2022.6
How to use jedis of redis
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 1)
官宣!第三届云原生编程挑战赛正式启动!
Interview summary: This is a comprehensive & detailed Android interview guide
UI自動化測試從此告別手動下載瀏覽器驅動
How about programmers' eyesight| Daily anecdotes
随机推荐
Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
Quick start of UI component development of phantom engine [umg/slate]
Why do some programmers change careers before they are 30?
[system security] ten thousand words summary system virtualization container bottom layer principle experiment
[array]566 Reshape the matrix - simple
[C language] address book - dynamic and static implementation
Timing manager based on C #
Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5
函数基础学习02
在线SQL转Excel(xls/xlsx)工具
Clickhouse物化视图
ClickPaaS低代码平台
Subversive cognition: what does SRE do?
Use object composition in preference to class inheritance
Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?
Deep learning - LSTM Foundation
CTF stegano practice stegano 9
EasyCVR更改录像存储路径,不生成录像文件如何解决?
UI自動化測試從此告別手動下載瀏覽器驅動
English essential vocabulary 3400