当前位置:网站首页>5+API,清除应用缓存
5+API,清除应用缓存
2022-06-26 12:32:00 【sunly_】
// 清除缓存
clear(){
plus.cache.clear(()=> {
uni.showToast({
title: '清理成功,请重新启动APP',
});
setTimeout(()=>{
plus.runtime.quit();
},1500)
this.getSize();
});
},
// 计算缓存大小
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);
})
},
边栏推荐
- Deep thinking from senior member managers
- Spark-day01- get started quickly
- NFS shared storage service installation
- 7-2 大盗阿福
- Ubuntu安装配置PostgreSQL(18.04)
- New routing file in laravel framework
- 2022 edition of Beijing 5g industry investment planning and development prospect forecast analysis report
- UDP协议详解[通俗易懂]
- Analysis report on the "fourteenth five year plan" and investment prospect of China's pharmaceutical equipment industry 2022-2028
- 2022 China smart bathroom cabinet Market Research and investment Competitiveness Analysis Report
猜你喜欢
Php+laravel5.7 use Alibaba oss+ Alibaba media to process and upload image / video files
JMeter response time and TPS listener tutorial
Scala-day03- operators and loop control
Spark-day02-core programming-rdd
简易数字电路交通灯设计
Realize microservice load balancing (ribbon)
Omni channel member link - tmall member link 3: preparation of member operation content
PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)
Laravel subdomain accesses different routing files and different modules
Deep thinking from senior member managers
随机推荐
Omnichannel membership - tmall membership 2: frequently asked questions
PHP generate order number
KITTI Tracking dataset whose format is letf_top_right_bottom to JDE normalied xc_yc_w_h
Report on in-depth analysis and investment strategy recommendations for China's petroleum coke industry (2022 Edition)
24 database interview questions that must be mastered!
Comparison of latest mobile phone processors in 2020 (with mobile phone CPU ladder diagram)
Mysql8 master-slave replication
Xiaolong 888 was released, Xiaomi 11 was launched, and 14 manufacturers carried it in the first batch!
1、 MySQL introduction
Scala-day03- operators and loop control
菜鸟实战UML——活动图
Redis cannot connect to the server through port 6379
Msvcr110 not found DLL, unable to continue code execution Solution for startup
Typescript learning (I) type
简易数字电路交通灯设计
做自媒体视频的各种常用工具合集奉上
Omnichannel membership - tmall membership 1: opening tutorial
Analysis report on the "fourteenth five year plan" and investment prospect of China's pharmaceutical equipment industry 2022-2028
Scala-day05-set
UDP protocol details [easy to understand]