当前位置:网站首页>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);
})
},
边栏推荐
- Question B of 2016 Sichuan Ti Cup Electronic Design Competition
- SQL injection
- Polarismesh series articles - concept series (I)
- Assembly language (7) operation instruction
- Spark-day02-core programming-rdd
- Msvcr110 not found DLL, unable to continue code execution Solution for startup
- The most complete kubernetes core command of the latest version so far
- International beauty industry giants bet on China
- Rookie practical UML - activity diagram
- What should I do from member labels to portraits?
猜你喜欢

Spark-day02-core programming-rdd

New routing file in laravel framework

Build Pikachu shooting range and introduction

1、 MySQL introduction

Scala-day02- variables and data types

This executeQuery (SQL) cannot compile classes for JSP. What is the reason?

Basic principle of MOS tube and important knowledge points of single chip microcomputer

Vscode solves the problem of Chinese garbled code
The loss of female scientists

JMeter response time and TPS listener tutorial
随机推荐
Introduction to the four major FPGA manufacturers abroad
Mysql8 master-slave replication
Rookie practical UML - activity diagram
[probability theory] conditional probability, Bayesian formula, correlation coefficient, central limit theorem, parameter estimation, hypothesis test
How do consumer goods enterprises formulate membership interests?
NFS shared storage service installation
Is it safe to open a securities account in general
Generate JDE dot train
Realize microservice load balancing (ribbon)
Spark-day01- get started quickly
一个初级多线程服务器模型
2022 edition of China's energy and chemical industry market in-depth investigation and investment feasibility analysis report
Precautions for opening a securities account is it safe to open an account
Scala-day02- variables and data types
Comparison of latest mobile phone processors in 2020 (with mobile phone CPU ladder diagram)
洛谷P3426 [POI2005]SZA-Template 题解
This executeQuery (SQL) cannot compile classes for JSP. What is the reason?
fastjson的JSONArray和JSONObject[通俗易懂]
初探Protostuff的使用[通俗易懂]
我想知道,股票开户有哪些优惠活动?网上开户是否安全么?