当前位置:网站首页>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 .
边栏推荐
- Yuancosmic ecological panorama [2022 latest]
- [luat-air105] 4.1 file system FS
- NPM introduction link symbolic link
- [C language] address book - dynamic and static implementation
- ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
- Containerd series - detailed explanation of plugins
- Quick start of UI component development of phantom engine [umg/slate]
- 在线SQL转Excel(xls/xlsx)工具
- [software reverse - basic knowledge] analysis method, assembly instruction architecture
- Necessary fonts for designers
猜你喜欢

error Couldn‘t find a package. JSON file in "your path“

Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant

@The problem of cross database query invalidation caused by transactional annotation

The new project Galaxy token just announced by coinlist is gal

EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
![[wp][入门]刷弱类型题目](/img/d0/9eb3ade701057837d98e4a20082a10.png)
[wp][入门]刷弱类型题目

Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?

Thread Basics

Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund

Special Edition: spreadjs v15.1 vs spreadjs v15.0
随机推荐
MySQL winter vacation self-study 2022 11 (9)
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
[wp]bmzclub writeup of several questions
Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?
speed or tempo in classical music
Redis6-01nosql database
灵魂三问:什么是接口测试,接口测试怎么玩,接口自动化测试怎么玩?
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
postman和postman interceptor的安装
[summary of two registration methods]
特殊版:SpreadJS v15.1 VS SpreadJS v15.0
[web Audit - source code disclosure] obtain source code methods and use tools
一文带你了解BI的前世今身与企业数字化转型的关系
Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
[brush questions] BFS topic selection
[learning notes] month end operation -gr/ir reorganization
UI automation test farewell to manual download of browser driver
English essential vocabulary 3400
Web components series (VII) -- life cycle of custom components
Smart pointer shared_ PTR and weak_ Difference of PTR
