01 2022 档案

摘要:const Store = require('electron-store') const { v4: uuidv4 } = require('uuid'); const path = require('path') class DataStore extends Store { construct 阅读全文
posted @ 2022-01-30 17:08 13522679763-任国强 阅读(216) 评论(0) 推荐(0)
摘要:exports.$ = (id) => { return document.getElementById(id) } exports.convertDuration = (time) => { // 计算分钟 02 020 const minutes = "0" + Math.floor(time/ 阅读全文
posted @ 2022-01-30 17:07 13522679763-任国强 阅读(48) 评论(0) 推荐(0)
摘要:封装公共窗口 class AppWindow extends BrowserWindow { constructor(config,fileLocation){ const baseConfig = { width: 800, height: 600, webPreferences: { nodeI 阅读全文
posted @ 2022-01-30 17:06 13522679763-任国强 阅读(28) 评论(0) 推荐(0)
摘要:// 自动打开调试窗口 mainWindow.webContents.openDevTools() 阅读全文
posted @ 2022-01-30 09:02 13522679763-任国强 阅读(27) 评论(0) 推荐(0)
摘要:npm i nodemon --save-dev 修改启动命令 "scripts": { "start": " nodemon --watch main.js --exec electron ." }, 阅读全文
posted @ 2022-01-30 09:02 13522679763-任国强 阅读(41) 评论(0) 推荐(0)
摘要:// 打开外部跳转链接 var { shell } = require('electron') var aHref = this.document.querySelector('#aHref') aHref.onclick = function(e){ e.preventDefault() var 阅读全文
posted @ 2022-01-30 09:01 13522679763-任国强 阅读(43) 评论(0) 推荐(0)
摘要:const {remote} = require('electron') var rightTemplate = [ { label:"粘贴" , accelerator:'ctrl+c', // 增加快捷键 }, { label:"复制", accelerator:'ctrl+v', // 增加快 阅读全文
posted @ 2022-01-30 09:01 13522679763-任国强 阅读(79) 评论(0) 推荐(0)
摘要:底部通知消息 <body> <button id="notifyBtn">通知消息</button> </body> <script> var notifyBtn = document.getElementById('notifyBtn') var option = { title:'小二,来订单了 阅读全文
posted @ 2022-01-30 09:00 13522679763-任国强 阅读(17) 评论(0) 推荐(0)
摘要:// 绑定全局快捷键 globalShortcut.register('ctrl+e',()=>{ mainWindow.loadURL('http://baidu.com/') }) // 判断是否绑定快捷键 let isRegister = globalShortcut.isRegistered 阅读全文
posted @ 2022-01-30 08:59 13522679763-任国强 阅读(144) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-01-30 08:58 13522679763-任国强 阅读(28) 评论(0) 推荐(0)
摘要:const dbRequest = indexedDB.open('Eric') dbRequest.onerror = function(err){ console.log('打开数据库失败~'); } let db = null dbRequest.onsuccess = function(ev 阅读全文
posted @ 2022-01-25 15:44 13522679763-任国强 阅读(30) 评论(0) 推荐(0)
摘要:class EricCache{ constructor(isLocal = true){ this.stroage = isLocal ? localStorage : sessionStorage } setItem(key,value){ if(value){ this.stroage.set 阅读全文
posted @ 2022-01-25 14:39 13522679763-任国强 阅读(37) 评论(0) 推荐(0)
摘要:// 1 写入 cookie // document.cookie = 'username=zs' // document.cookie = 'age=18' // 读取cookie (读取的是全部的cookie) // console.log(document.cookie); // userna 阅读全文
posted @ 2022-01-24 21:54 13522679763-任国强 阅读(72) 评论(0) 推荐(0)