当前位置:网站首页>Indexeddb local storage, homepage optimization
Indexeddb local storage, homepage optimization
2022-06-24 09:50:00 【Time202051】
<el-button type="primary" @click="createdDB"> Create database </el-button>
<el-button type="primary" @click="addDB"> Add data </el-button>
var db;
createdDB() {
var request = window.indexedDB.open("db", 3);
request.onsuccess = function (e) {
db = e.target.result;
console.log(" Database open successfully ", db);
};
request.onupgradeneeded = function (event) {
db = event.target.result;
var objectStore;
if (!db.objectStoreNames.contains("person")) {
objectStore = db.createObjectStore("person", {
keyPath: "id" });
}
};
},
addDB() {
db.transaction(["person"], "readwrite")
.objectStore("person")
.add({
id: 0, name: " Xiao Ming ", age: 12 });
},

边栏推荐
猜你喜欢

Practical analysis: implementation principle of APP scanning code landing (app+ detailed logic on the web side) with source code

The ambition of JD instant retailing from 618

tp5 使用post接收数组数据时报variable type error: array错误的解决方法

canvas 绘制图片

顶刊TPAMI 2022!基于不同数据模态的行为识别:最新综述

Latex formula and table recognition

vim的使用

Analysis of 43 cases of MATLAB neural network: Chapter 32 time series prediction of wavelet neural network - short-term traffic flow prediction

如何提高网络基础设施排障效率,告别数据断档?

Amazing tips for using live chat to drive business sales
随机推荐
Algorithm -- find and maximum length k subsequence (kotlin)
ThinkPHP5多语言切换项目实战
实战剖析:app扫码登陆实现原理(app+网页端详细逻辑)附源码
2021-08-17
PostgreSQL DBA快速入门-通过源码编译安装
grpc本地测试联调工具BloomRPC
Can the long-term financial products you buy be shortened?
[Eureka registry]
Turn to: CEO of Samsung Electronics: all decisions should start from recognizing yourself
ORA-16038 ORA-19502 ORA-00312故障处理
Amazing tips for using live chat to drive business sales
P6698-[balticoi 2020 day2] virus [AC automata, DP, SPFA]
Oracle database expdp only exports tables
In depth analysis of Apache bookkeeper series: Part 3 - reading principle
CF566E-Restoring Map【bitset】
How do novices choose the grade of investment and financial products?
PHP封装一个文件上传类(支持单文件多文件上传)
生产者/消费者模型
Directly applicable go coding specification
十大证券公司哪个佣金最低,最安全可靠?有知道的吗