当前位置:网站首页>Electric store stores data
Electric store stores data
2022-06-25 05:09:00 【Lijianyi】
I don't use database scheme to store data , Simply storing a small amount of simple data does not involve the use of databases . The choice here is electron-store As the primary storage tool , This tool is excellent even if it is not the primary storage tool for storing only user startup items .
install electron-store, If you use npm If the installation is unsuccessful, use cnpm install , There's always one for you .
Usage method :
const Store = require('electron-store');
const store = new Store();
// If encrypted storage is required Just use the following
//const store = new Store({encryptionKey: ' Encrypted value '});
store.set('unicorn', ' This is what needs to be stored ');
console.log(store.get('unicorn')); //=> ' This is what needs to be stored '
// Use dot-notation to access nested properties
store.set('foo.bar', true);
console.log(store.get('foo')); //=> {bar: true}
store.delete('unicorn');
console.log(store.get('unicorn')); //=> undefined
This code is in main > index.js Try bailing , But in vue The file is surprisingly difficult to use , I'm stuck here 2 Time of day , After adding the corresponding code, the screen will be blank , The page shows nothing , Don't complain .
The final solution is : Downgrade !
When the version is reduced to 4.0 In the future, all the above problems will be solved ~
Not sure 4.0 Can the above version , I tested it directly 4.0, Interested students can test other versions .
Storage uses json file , My storage address here is C:\Users\Administrator\AppData\Roaming\ Project name \config.json
边栏推荐
- XML (VIII)
- How to install the blue lake plug-in to support Photoshop CC 2017
- Abuse unlimited authorization -- is your address safe?
- Laravel's little knowledge
- DOM document object model (I)
- Page electronic clock (use js to dynamically obtain time display)
- Various pits encountered in the configuration of yolov3 on win10
- 融合CDN,为客户打造极致服务体验!
- Ctfhub eggs
- Detailed summary of flex layout
猜你喜欢

In Net 6 using dotnet format formatting code

ASEMI大功率场效应管和三极管的区别

Notes on non replacement elements in the line (padding, margin, and border)
![Bind simulation, key points of interpreting bind handwritten code [details]](/img/03/6aa300bb8b8342199aed5a819f3634.jpg)
Bind simulation, key points of interpreting bind handwritten code [details]

Read the general components of antd source code

Small sample learning data set

Use js to simply implement the apply, call and bind methods

hr竟主动给这位测试小姐姐涨工资,她是怎么做到的?

Detailed summary of float

Five simple data types of JS
随机推荐
Flex flexible layout for mobile terminal page production
Visual studio 2022 interface beautification tutorial
Filter & listener (XIV)
Matlab notes
How to download and use Xiaobai one click reload on the official website
Summary of SQL injection (I)
Database overview
OLAP analysis engine kylin4.0
File upload vulnerability (III)
Startup mode of SoC verification environment
Integrate CDN to create the ultimate service experience for customers!
Eyeshot 2022 Released
Small sample learning data set
SQL lab range explanation
JS, BOM, DOM (VI)
Swift rapid development
win11蓝牙无法连接怎么办?win11蓝牙无法连接的解决方法
Reading and writing of nodejs excel (.Xlsx) files
Bind simulation, key points of interpreting bind handwritten code [details]
Basic knowledge of web pages (URL related)