当前位置:网站首页>5+api, clear application cache
5+api, clear application cache
2022-06-26 13:19:00 【sunly_】
// Clear cache
clear(){
plus.cache.clear(()=> {
uni.showToast({
title: ' Clean up successful , Please restart APP',
});
setTimeout(()=>{
plus.runtime.quit();
},1500)
this.getSize();
});
},
// Calculate cache size
getSize() {
plus.cache.calculate((size) => {
if (size == 0) {
this.cacheSize = "0B";
} else if (size < 1024) {
this.cacheSize = size + "B";
} else if (size < 1048576) {
this.cacheSize = (size / 1024).toFixed(2) + "KB";
} else if (size < 1073741824) {
this.cacheSize = (size / 1048576).toFixed(2) + "MB";
} else {
this.cacheSize = (size / 1073741824).toFixed(2) + "GB";
}
console.log(this.cacheSize);
})
},
边栏推荐
- scrapy——爬取漫画自定义存储路径下载到本地
- F - Charm Bracelet
- Solutions to insufficient display permissions of find and Du -sh
- Script - crawl the customized storage path of the cartoon and download it to the local
- 利用scrapy爬取句子迷网站优美句子存储到本地(喜欢摘抄的人有福了!)
- 首批通过!百度智能云曦灵平台获信通院数字人能力评测权威认证
- Machine learning notes - seasonality of time series
- HDU 3555 Bomb
- Chapter 01_ Installation and use of MySQL under Linux
- LeetCode_ Stack_ Medium_ 150. evaluation of inverse Polish expression
猜你喜欢

Arcpy -- use of insertlayer() function: adding layers to map documents
Summary of wechat applet test points

Basic methods for network diagnosis and hardware troubleshooting of Beifu EtherCAT module

C语言:练习题二

Chapter 01_ Installation and use of MySQL under Linux

Arcpy——InsertLayer()函数的使用:掺入图层到地图文档里

Beifu PLC obtains system time, local time, current time zone and system time zone conversion through program

Script - crawl the customized storage path of the cartoon and download it to the local

Analysis of state transition diagram of Beifu NC axis

Basic configuration and test of Beifu twincat3 NCI in NC axis interface
随机推荐
偶言佳句,孤芳自赏
OPLG: 新一代云原生可观测最佳实践
桥接模式(Bridge)
H5 video automatic playback and circular playback
D - skiing
F - Charm Bracelet
Chapter 01_ Installation and use of MySQL under Linux
体现技术深度(无法速成)
G - Cow Bowling
MariaDB study notes
Processing polyhedron change
Enjoy element mode (flyweight)
H5视频自动播放和循环播放
[how to connect the network] Chapter 2 (next): receiving a network packet
Electron official docs series: References
Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city
中国剩余定理模板题 互质与非互质
MySQL数据库讲解(三)
Mysql database explanation (6)
解中小企业之困,百度智能云打个样