02 2022 档案
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:// var $p = $('<p id="insert">我是新添加的p标签</p>') var $p = $('<p>我是新添加的p标签</p>',{ id:'insert', class:"insert" }) $('#box').append($p) var $box = $('#box')
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:const fs = window.require('fs').promises // const path = window.require('path') const fileHelper = { readFile:(path) => { return fs.readFile(path,{enc
阅读全文
摘要:export const flattenArr = (arr) => { return arr.reduce((map,item)=>{ map[item.id] = item return map },{}) } export const objToArr = (obj) => { return
阅读全文
摘要:async function renderMovie(){ const res = await fetch('/api/getMovie') const json = await res.json() let data = json.data.house43 console.log(data); l
阅读全文
摘要:// install 主要就是缓存内容 const CACHE_NAME = 'cahe_v1' const URLS = [ '/', '/index.css', '/images/1.png', '/index.js', '/manifest.json', '/api/66462d0145d35
阅读全文
摘要:service worker 使用步骤 <script> // 1 在网页加载完成的时候 注册 service worker window.addEventListener('load', () => { // 2 能力检测 if ('serviceWorker' in navigator) { n
阅读全文
摘要:/** * 如果页面一进来, 发现用户没有联网,给用户发一个通知 * */ if(Notification.permission 'default'){ Notification.requestPermission() } if(!navigator.onLine){ new Notificatio
阅读全文
摘要:manifest 使用步骤 1 新建一个 manifest.json 文件 2 在 index.html 引入 manifest.json 文件 3 在 manifest.json 文件中提供常见的配置 4 需要在 https 协议或者 http://localhost 下访问项目 <link re
阅读全文
摘要:const { BrowserWindow } = require('electron') class AppWindow extends BrowserWindow { constructor(config,urlLocation){ const basicConfig = { width:102
阅读全文
摘要:cnpm i --save-dev devtron require('devtron').install() mainWindow.webContents.openDevTools()
阅读全文
摘要:const { ipcRenderer } = require('electron') window.addEventListener('DOMContentLoaded', () => { document.getElementById('node-version').innerHTML = pr
阅读全文
摘要:-- 是否为 发开环境 cnpm install electron-is-dev --save-dev npm install concurrently --save-dev npm install nodemon --save-dev npm i nodemon --save-dev 配置命令 "
阅读全文
摘要:// 导入文件 const importFiles = () => { remote.dialog.showOpenDialog({ title:'选择导入的 markdown 文件', properties:['openfile','multiSelections'], filters:[ {na
阅读全文
摘要:const {app,shell } = require('electron') let template = [ { label:'文件', submenu:[ { label:'新建', accelerator:'CmdOrCtrl+N', click:(menuItem,browserWind
阅读全文
摘要:remote.getCurrentWindow().close()
阅读全文
摘要:const Store = require('electron-store') const settingsStore = new Store({name:'Settings'}) let savedLocation = settingsStore.get('saveFileLocation') i
阅读全文