[{"data":1,"prerenderedAt":3537},["ShallowReactive",2],{"navigation":3,"/document/electron/guide/process-model":1617,"/document/electron/guide/process-model-surround":3532},[4],{"title":5,"path":6,"stem":7,"children":8,"page":50},"Document","/document","document",[9,51,118,150,207,263,307,343,363,403,447,479,518,558,585,609,633,665,700,731,762,794,831,863,899,929,964,1000,1036,1075,1110,1149,1181,1212,1243,1271,1307,1346,1378,1418,1455,1487,1519],{"title":10,"path":11,"stem":12,"children":13,"page":50},"Html5","/document/html5","document/01.html5",[14,42],{"title":15,"path":16,"stem":17,"children":18,"icon":41},"指南","/document/html5/guide","document/01.html5/01.guide/01.index",[19,21,25,29,33,37],{"title":20,"path":16,"stem":17},"HTML 入门教程",{"title":22,"path":23,"stem":24},"常用标签详解","/document/html5/guide/tag","document/01.html5/01.guide/02.tag",{"title":26,"path":27,"stem":28},"布局与语义标签","/document/html5/guide/layout","document/01.html5/01.guide/03.layout",{"title":30,"path":31,"stem":32},"表单设计与用户输入","/document/html5/guide/form","document/01.html5/01.guide/04.form",{"title":34,"path":35,"stem":36},"多媒体与 HTML5 新特性","/document/html5/guide/html5","document/01.html5/01.guide/05.html5",{"title":38,"path":39,"stem":40},"Web 标准与 HTML 编写规范","/document/html5/guide/web","document/01.html5/01.guide/06.web","i-lucide-code",{"title":43,"path":44,"stem":45,"children":46,"icon":49},"考核","/document/html5/examine","document/01.html5/02.examine/01.index",[47],{"title":48,"path":44,"stem":45},"接下来对你进行考核","i-lucide-clipboard-check",false,{"title":52,"path":53,"stem":54,"children":55,"page":50},"Css","/document/css","document/02.css",[56,75,100,113],{"title":57,"path":58,"stem":59,"children":60,"icon":50},"启航","/document/css/guide","document/02.css/01.guide/01.index",[61,63,67,71],{"title":62,"path":58,"stem":59},"CSS 基础入门教程",{"title":64,"path":65,"stem":66},"文本与盒子样式详解","/document/css/guide/styles","document/02.css/01.guide/02.styles",{"title":68,"path":69,"stem":70},"选择器与权重机制","/document/css/guide/selected","document/02.css/01.guide/03.selected",{"title":72,"path":73,"stem":74},"盒模型详解","/document/css/guide/box","document/02.css/01.guide/04.box",{"title":76,"icon":50,"path":77,"stem":78,"children":79,"page":50},"布局","/document/css/layout","document/02.css/02.layout",[80,84,88,92,96],{"title":81,"path":82,"stem":83},"网页布局三剑客详解","/document/css/layout/policy","document/02.css/02.layout/01.policy",{"title":85,"path":86,"stem":87},"Position 定位详解","/document/css/layout/position","document/02.css/02.layout/02.position",{"title":89,"path":90,"stem":91},"Flexbox 布局入门指南","/document/css/layout/flex","document/02.css/02.layout/03.flex",{"title":93,"path":94,"stem":95},"Grid 布局入门指南","/document/css/layout/grid","document/02.css/02.layout/04.grid",{"title":97,"path":98,"stem":99},"响应式设计指南","/document/css/layout/relative","document/02.css/02.layout/05.relative",{"title":101,"icon":50,"path":102,"stem":103,"children":104,"page":50},"使用技巧","/document/css/skill","document/02.css/03.skill",[105,109],{"title":106,"path":107,"stem":108},"CSS 动画全解析","/document/css/skill/animation","document/02.css/03.skill/01.animation",{"title":110,"path":111,"stem":112},"CSS 使用技巧全攻略","/document/css/skill/skill","document/02.css/03.skill/02.skill",{"title":43,"path":114,"stem":115,"children":116,"icon":49},"/document/css/examine","document/02.css/04.examine/01.index",[117],{"title":48,"path":114,"stem":115},{"title":119,"path":120,"stem":121,"children":122,"page":50},"Git","/document/git","document/03.git",[123,145],{"title":57,"path":124,"stem":125,"children":126,"icon":50},"/document/git/guide","document/03.git/01.guide/01.index",[127,129,133,137,141],{"title":128,"path":124,"stem":125},"Git 入门指南",{"title":130,"path":131,"stem":132},"Git 安装与初体验","/document/git/guide/install","document/03.git/01.guide/02.install",{"title":134,"path":135,"stem":136},"常用 Git 命令详解","/document/git/guide/command","document/03.git/01.guide/03.command",{"title":138,"path":139,"stem":140},"Git 分支管理全解析","/document/git/guide/branch","document/03.git/01.guide/04.branch",{"title":142,"path":143,"stem":144},"使用 GitHub 轻松托管和管理代码","/document/git/guide/github","document/03.git/01.guide/05.github",{"title":43,"path":146,"stem":147,"children":148,"icon":49},"/document/git/examine","document/03.git/02.examine/01.index",[149],{"title":48,"path":146,"stem":147},{"title":151,"path":152,"stem":153,"children":154,"page":50},"Js Base","/document/js-base","document/04.js-base",[155,185,202],{"title":15,"path":156,"stem":157,"children":158,"icon":41},"/document/js-base/guide","document/04.js-base/01.guide/01.index",[159,161,165,169,173,177,181],{"title":160,"path":156,"stem":157},"JavaScript 基础快速入门",{"title":162,"path":163,"stem":164},"搞懂变量与数据类型","/document/js-base/guide/variable","document/04.js-base/01.guide/02.variable",{"title":166,"path":167,"stem":168},"JavaScript 运算符详解","/document/js-base/guide/operator","document/04.js-base/01.guide/03.operator",{"title":170,"path":171,"stem":172},"条件判断与循环语句","/document/js-base/guide/flow","document/04.js-base/01.guide/04.flow",{"title":174,"path":175,"stem":176},"深入理解 JavaScript 函数","/document/js-base/guide/function","document/04.js-base/01.guide/05.function",{"title":178,"path":179,"stem":180},"对象数组的创建与操作","/document/js-base/guide/object","document/04.js-base/01.guide/06.object",{"title":182,"path":183,"stem":184},"Math 和 Date 用法详解","/document/js-base/guide/math","document/04.js-base/01.guide/07.math",{"title":186,"icon":41,"path":187,"stem":188,"children":189,"page":50},"浏览器","/document/js-base/browser","document/04.js-base/02.browser",[190,194,198],{"title":191,"path":192,"stem":193},"DOM 操作入门与实战","/document/js-base/browser/dom","document/04.js-base/02.browser/01.dom",{"title":195,"path":196,"stem":197},"浏览器 BOM 基础知识","/document/js-base/browser/bom","document/04.js-base/02.browser/02.bom",{"title":199,"path":200,"stem":201},"JavaScript 事件处理机制","/document/js-base/browser/event","document/04.js-base/02.browser/03.event",{"title":43,"path":203,"stem":204,"children":205,"icon":49},"/document/js-base/examine","document/04.js-base/03.examine/01.index",[206],{"title":48,"path":203,"stem":204},{"title":208,"path":209,"stem":210,"children":211,"page":50},"Js Advanced","/document/js-advanced","document/05.js-advanced",[212,231,249],{"title":213,"path":214,"stem":215,"children":216,"icon":41},"JavaScript 原理","/document/js-advanced/guide","document/05.js-advanced/01.guide/01.index",[217,219,223,227],{"title":218,"path":214,"stem":215},"JavaScript 是怎么运行的？",{"title":220,"path":221,"stem":222},"深入理解函数和作用域","/document/js-advanced/guide/function","document/05.js-advanced/01.guide/02.function",{"title":224,"path":225,"stem":226},"深入理解 this 指向","/document/js-advanced/guide/this","document/05.js-advanced/01.guide/03.this",{"title":228,"path":229,"stem":230},"浅拷贝与深拷贝详解","/document/js-advanced/guide/copy","document/05.js-advanced/01.guide/04.copy",{"title":232,"icon":233,"path":234,"stem":235,"children":236,"page":50},"编程范式","i-lucide-shapes","/document/js-advanced/program","document/05.js-advanced/02.program",[237,241,245],{"title":238,"path":239,"stem":240},"面向对象编程（OOP）","/document/js-advanced/program/object","document/05.js-advanced/02.program/01.object",{"title":242,"path":243,"stem":244},"函数式编程入门","/document/js-advanced/program/fp","document/05.js-advanced/02.program/02.fp",{"title":246,"path":247,"stem":248},"防抖和节流详解","/document/js-advanced/program/debounce","document/05.js-advanced/02.program/03.debounce",{"title":250,"icon":251,"path":252,"stem":253,"children":254,"page":50},"浏览器相关特性","i-lucide-monitor","/document/js-advanced/browser","document/05.js-advanced/03.browser",[255,259],{"title":256,"path":257,"stem":258},"浏览器缓存入门指南","/document/js-advanced/browser/cache","document/05.js-advanced/03.browser/01.cache",{"title":260,"path":261,"stem":262},"Web 存储机制深度剖析","/document/js-advanced/browser/storage","document/05.js-advanced/03.browser/02.storage",{"title":264,"path":265,"stem":266,"children":267,"page":50},"Es6","/document/es6","document/06.es6",[268,302],{"title":213,"path":269,"stem":270,"children":271,"icon":41},"/document/es6/guide","document/06.es6/01.guide/01.index",[272,274,278,282,286,290,294,298],{"title":273,"path":269,"stem":270},"ES6 入门指南",{"title":275,"path":276,"stem":277},"变量声明：let 与 const","/document/es6/guide/const","document/06.es6/01.guide/02.const",{"title":279,"path":280,"stem":281},"箭头函数的用法与特点","/document/es6/guide/arrow","document/06.es6/01.guide/03.arrow",{"title":283,"path":284,"stem":285},"字符串、对象与数组的新特性","/document/es6/guide/enhance","document/06.es6/01.guide/04.enhance",{"title":287,"path":288,"stem":289},"Map 和 Set 的使用方式","/document/es6/guide/set","document/06.es6/01.guide/05.set",{"title":291,"path":292,"stem":293},"Promise 实现异步流程控制","/document/es6/guide/promise","document/06.es6/01.guide/06.promise",{"title":295,"path":296,"stem":297},"ESM 模块化语法解析","/document/es6/guide/esm","document/06.es6/01.guide/07.esm",{"title":299,"path":300,"stem":301},"Class 的定义与继承机制","/document/es6/guide/class","document/06.es6/01.guide/08.class",{"title":43,"path":303,"stem":304,"children":305,"icon":49},"/document/es6/examine","document/06.es6/02.examine/01.index",[306],{"title":48,"path":303,"stem":304},{"title":308,"path":309,"stem":310,"children":311,"page":50},"Js Algorithms","/document/js-algorithms","document/07.js-algorithms",[312,338],{"title":15,"path":313,"stem":314,"children":315,"icon":41},"/document/js-algorithms/guide","document/07.js-algorithms/01.guide/01.index",[316,318,322,326,330,334],{"title":317,"path":313,"stem":314},"什么是数据结构和算法？",{"title":319,"path":320,"stem":321},"时间和空间复杂度","/document/js-algorithms/guide/complexity","document/07.js-algorithms/01.guide/02.complexity",{"title":323,"path":324,"stem":325},"数据结构","/document/js-algorithms/guide/structure","document/07.js-algorithms/01.guide/03.structure",{"title":327,"path":328,"stem":329},"算法","/document/js-algorithms/guide/algorithms","document/07.js-algorithms/01.guide/04.algorithms",{"title":331,"path":332,"stem":333},"算法思想","/document/js-algorithms/guide/heuristic","document/07.js-algorithms/01.guide/05.heuristic",{"title":335,"path":336,"stem":337},"深度优先与广度优先搜索","/document/js-algorithms/guide/search","document/07.js-algorithms/01.guide/06.search",{"title":43,"path":339,"stem":340,"children":341,"icon":49},"/document/js-algorithms/examine","document/07.js-algorithms/02.examine/01.index",[342],{"title":48,"path":339,"stem":340},{"title":344,"path":345,"stem":346,"children":347,"page":50},"Automation","/document/automation","document/08.automation",[348,358],{"title":15,"path":349,"stem":350,"children":351,"icon":41},"/document/automation/guide","document/08.automation/01.guide/01.index",[352,354],{"title":353,"path":349,"stem":350},"什么是前端工程化？",{"title":355,"path":356,"stem":357},"开始搭建工程化项目","/document/automation/guide/start","document/08.automation/01.guide/02.start",{"title":43,"path":359,"stem":360,"children":361,"icon":49},"/document/automation/examine","document/08.automation/02.examine/01.index",[362],{"title":48,"path":359,"stem":360},{"title":364,"path":365,"stem":366,"children":367,"page":50},"Webpack","/document/webpack","document/09.webpack",[368,398],{"title":15,"path":369,"stem":370,"children":371,"icon":41},"/document/webpack/guide","document/09.webpack/01.guide/01.index",[372,374,378,382,386,390,394],{"title":373,"path":369,"stem":370},"Webpack 初识",{"title":375,"path":376,"stem":377},"搭建 Webpack 项目","/document/webpack/guide/start","document/09.webpack/01.guide/02.start",{"title":379,"path":380,"stem":381},"Loader 加载器","/document/webpack/guide/loader","document/09.webpack/01.guide/03.loader",{"title":383,"path":384,"stem":385},"Plugin 插件","/document/webpack/guide/plugin","document/09.webpack/01.guide/04.plugin",{"title":387,"path":388,"stem":389},"HMR 热更新与开发模式","/document/webpack/guide/dev","document/09.webpack/01.guide/05.dev",{"title":391,"path":392,"stem":393},"性能优化配置","/document/webpack/guide/optimize","document/09.webpack/01.guide/06.optimize",{"title":395,"path":396,"stem":397},"webpack 生产环境构建全攻略","/document/webpack/guide/production","document/09.webpack/01.guide/07.production",{"title":43,"path":399,"stem":400,"children":401,"icon":49},"/document/webpack/examine","document/09.webpack/02.examine/01.index",[402],{"title":48,"path":399,"stem":400},{"title":404,"path":405,"stem":406,"children":407,"page":50},"Scss","/document/scss","document/10.scss",[408,442],{"title":15,"path":409,"stem":410,"children":411,"icon":41},"/document/scss/guide","document/10.scss/01.guide/01.index",[412,414,418,422,426,430,434,438],{"title":413,"path":409,"stem":410},"什么是 SCSS？",{"title":415,"path":416,"stem":417},"SCSS 入门语法基础","/document/scss/guide/syntax","document/10.scss/01.guide/02.syntax",{"title":419,"path":420,"stem":421},"开始编写 Scss 项目","/document/scss/guide/start","document/10.scss/01.guide/03.start",{"title":423,"path":424,"stem":425},"Scss 模块导入方式","/document/scss/guide/import","document/10.scss/01.guide/04.import",{"title":427,"path":428,"stem":429},"Mixin 与函数详解","/document/scss/guide/mixin","document/10.scss/01.guide/05.mixin",{"title":431,"path":432,"stem":433},"Scss 继承、占位符技巧","/document/scss/guide/extend","document/10.scss/01.guide/06.extend",{"title":435,"path":436,"stem":437},"SCSS 流程控制与逻辑语法","/document/scss/guide/flow","document/10.scss/01.guide/07.flow",{"title":439,"path":440,"stem":441},"SCSS 内置函数","/document/scss/guide/function","document/10.scss/01.guide/08.function",{"title":43,"path":443,"stem":444,"children":445,"icon":49},"/document/scss/examine","document/10.scss/02.examine/01.index",[446],{"title":48,"path":443,"stem":444},{"title":448,"path":449,"stem":450,"children":451,"page":50},"Eslint","/document/eslint","document/11.eslint",[452,474],{"title":15,"path":453,"stem":454,"children":455,"icon":41},"/document/eslint/guide","document/11.eslint/01.guide/01.index",[456,458,462,466,470],{"title":457,"path":453,"stem":454},"ESLint 是什么？",{"title":459,"path":460,"stem":461},"ESLint 安装与运行详解","/document/eslint/guide/install","document/11.eslint/01.guide/02.install",{"title":463,"path":464,"stem":465},"ESLint  规则介绍","/document/eslint/guide/rule","document/11.eslint/01.guide/03.rule",{"title":467,"path":468,"stem":469},"集成 ESLint 到 Webpack","/document/eslint/guide/webpack","document/11.eslint/01.guide/04.webpack",{"title":471,"path":472,"stem":473},"Plugins 和 Extends 使用","/document/eslint/guide/plugins","document/11.eslint/01.guide/05.plugins",{"title":43,"path":475,"stem":476,"children":477,"icon":49},"/document/eslint/examine","document/11.eslint/02.examine/01.index",[478],{"title":48,"path":475,"stem":476},{"title":480,"path":481,"stem":482,"children":483,"page":50},"Axios","/document/axios","document/12.axios",[484,494,513],{"title":15,"path":485,"stem":486,"children":487,"icon":41},"/document/axios/guide","document/12.axios/01.guide/01.index",[488,490],{"title":489,"path":485,"stem":486},"HTTP 协议与网络请求",{"title":491,"path":492,"stem":493},"使用 JavaScript 发起请求","/document/axios/guide/get","document/12.axios/01.guide/02.get",{"title":495,"path":496,"stem":497,"children":498,"icon":41},"axios 插件","/document/axios/axios","document/12.axios/02.axios/01.index",[499,501,505,509],{"title":500,"path":496,"stem":497},"Axios 入门",{"title":502,"path":503,"stem":504},"Axios 请求基础全面讲解","/document/axios/axios/start","document/12.axios/02.axios/02.start",{"title":506,"path":507,"stem":508},"Axios 高级使用技巧","/document/axios/axios/advenced","document/12.axios/02.axios/03.advenced",{"title":510,"path":511,"stem":512},"CORS 跨域解决方案","/document/axios/axios/cors","document/12.axios/02.axios/04.cors",{"title":43,"path":514,"stem":515,"children":516,"icon":49},"/document/axios/examine","document/12.axios/03.examine/01.index",[517],{"title":48,"path":514,"stem":515},{"title":519,"path":520,"stem":521,"children":522,"page":50},"Typescript","/document/typescript","document/13.typescript",[523,553],{"title":15,"path":524,"stem":525,"children":526,"icon":41},"/document/typescript/guide","document/13.typescript/01.guide/01.index",[527,529,533,537,541,545,549],{"title":528,"path":524,"stem":525},"TypeScript 简介与入门",{"title":530,"path":531,"stem":532},"类型系统基础","/document/typescript/guide/base","document/13.typescript/01.guide/02.base",{"title":534,"path":535,"stem":536},"类型组合与类型保护","/document/typescript/guide/compose","document/13.typescript/01.guide/03.compose",{"title":538,"path":539,"stem":540},"类与面向对象编程","/document/typescript/guide/class","document/13.typescript/01.guide/04.class",{"title":542,"path":543,"stem":544},"泛型与类型复用","/document/typescript/guide/generic","document/13.typescript/01.guide/05.generic",{"title":546,"path":547,"stem":548},"项目进阶与配置实战","/document/typescript/guide/config","document/13.typescript/01.guide/06.config",{"title":550,"path":551,"stem":552},"第三方库类型支持与声明","/document/typescript/guide/declare","document/13.typescript/01.guide/07.declare",{"title":43,"path":554,"stem":555,"children":556,"icon":49},"/document/typescript/examine","document/13.typescript/02.examine/01.index",[557],{"title":48,"path":554,"stem":555},{"title":559,"path":560,"stem":561,"children":562,"page":50},"Vue2","/document/vue2","document/14.vue2",[563],{"title":15,"path":564,"stem":565,"children":566,"icon":41},"/document/vue2/guide","document/14.vue2/01.guide/01.index",[567,569,573,577,581],{"title":568,"path":564,"stem":565},"Vue 2 入门与安装",{"title":570,"path":571,"stem":572},"模板语法与指令详解","/document/vue2/guide/directive","document/14.vue2/01.guide/02.directive",{"title":574,"path":575,"stem":576},"组件化开发基础","/document/vue2/guide/component","document/14.vue2/01.guide/03.component",{"title":578,"path":579,"stem":580},"计算属性与监听器","/document/vue2/guide/reactive","document/14.vue2/01.guide/04.reactive",{"title":582,"path":583,"stem":584},"生命周期钩子解析","/document/vue2/guide/hooks","document/14.vue2/01.guide/05.hooks",{"title":586,"path":587,"stem":588,"children":589,"page":50},"Router","/document/router","document/15.router",[590],{"title":591,"path":592,"stem":593,"children":594,"icon":41},"Vue Router 路由","/document/router/guide","document/15.router/01.guide/01.index",[595,597,601,605],{"title":596,"path":592,"stem":593},"Vue Router 入门",{"title":598,"path":599,"stem":600},"路由核心功能详解","/document/router/guide/routing","document/15.router/01.guide/02.routing",{"title":602,"path":603,"stem":604},"路由守卫钩子和元信息","/document/router/guide/hook","document/15.router/01.guide/03.hook",{"title":606,"path":607,"stem":608},"路由优化与懒加载","/document/router/guide/optimize","document/15.router/01.guide/04.optimize",{"title":610,"path":611,"stem":612,"children":613,"page":50},"Vuex","/document/vuex","document/16.vuex",[614],{"title":615,"path":616,"stem":617,"children":618,"icon":41},"Vuex 状态管理器","/document/vuex/guide","document/16.vuex/01.guide/01.index",[619,621,625,629],{"title":620,"path":616,"stem":617},"为什么要使用 Vuex？",{"title":622,"path":623,"stem":624},"快速上手 Vuex","/document/vuex/guide/start","document/16.vuex/01.guide/02.start",{"title":626,"path":627,"stem":628},"深入理解 Vuex 核心功能","/document/vuex/guide/core","document/16.vuex/01.guide/03.core",{"title":630,"path":631,"stem":632},"模块化与进阶用法","/document/vuex/guide/module","document/16.vuex/01.guide/04.module",{"title":634,"path":635,"stem":636,"children":637,"page":50},"Element Ui","/document/element-ui","document/17.element-ui",[638],{"title":639,"path":640,"stem":641,"children":642,"icon":41},"Element UI 组件库","/document/element-ui/guide","document/17.element-ui/01.guide/01.index",[643,645,649,653,657,661],{"title":644,"path":640,"stem":641},"Element UI 初体验",{"title":646,"path":647,"stem":648},"常用组件快速上手","/document/element-ui/guide/quickstart","document/17.element-ui/01.guide/02.quickstart",{"title":650,"path":651,"stem":652},"布局与结构类组件","/document/element-ui/guide/layout","document/17.element-ui/01.guide/03.layout",{"title":654,"path":655,"stem":656},"自定义组件样式","/document/element-ui/guide/style","document/17.element-ui/01.guide/04.style",{"title":658,"path":659,"stem":660},"组件封装与复用","/document/element-ui/guide/component","document/17.element-ui/01.guide/05.component",{"title":662,"path":663,"stem":664},"自定义主题色与深色模式","/document/element-ui/guide/theme","document/17.element-ui/01.guide/06.theme",{"title":666,"path":667,"stem":668,"children":669,"page":50},"Vue3","/document/vue3","document/18.vue3",[670],{"title":666,"path":671,"stem":672,"children":673,"icon":41},"/document/vue3/guide","document/18.vue3/01.guide/01.index",[674,676,680,684,688,692,696],{"title":675,"path":671,"stem":672},"Vue 3 概览与生态升级",{"title":677,"path":678,"stem":679},"组合式 API 入门指南","/document/vue3/guide/composition","document/18.vue3/01.guide/02.composition",{"title":681,"path":682,"stem":683},"组合式 API 逻辑抽离","/document/vue3/guide/composable","document/18.vue3/01.guide/03.composable",{"title":685,"path":686,"stem":687},"模板语法及新特性","/document/vue3/guide/features","document/18.vue3/01.guide/04.features",{"title":689,"path":690,"stem":691},"TypeScript 开发支持","/document/vue3/guide/typescript","document/18.vue3/01.guide/05.typescript",{"title":693,"path":694,"stem":695},"响应式系统原理与进阶 API","/document/vue3/guide/reactive","document/18.vue3/01.guide/06.reactive",{"title":697,"path":698,"stem":699},"Vue Router 4 路由实战","/document/vue3/guide/vue-router","document/18.vue3/01.guide/07.vue-router",{"title":701,"path":702,"stem":703,"children":704,"page":50},"Pinia","/document/pinia","document/19.pinia",[705],{"title":701,"path":706,"stem":707,"children":708,"icon":41},"/document/pinia/guide","document/19.pinia/01.guide/01.index",[709,711,715,719,723,727],{"title":710,"path":706,"stem":707},"Pinia 简介与安装",{"title":712,"path":713,"stem":714},"Store 三大核心","/document/pinia/guide/store","document/19.pinia/01.guide/02.store",{"title":716,"path":717,"stem":718},"在组件中使用 Store","/document/pinia/guide/usage","document/19.pinia/01.guide/03.usage",{"title":720,"path":721,"stem":722},"State 修改与响应式细节","/document/pinia/guide/state","document/19.pinia/01.guide/04.state",{"title":724,"path":725,"stem":726},"Action 与异步操作","/document/pinia/guide/action","document/19.pinia/01.guide/05.action",{"title":728,"path":729,"stem":730},"组合、TypeScript 与插件","/document/pinia/guide/advanced","document/19.pinia/01.guide/06.advanced",{"title":732,"path":733,"stem":734,"children":735,"page":50},"Vite","/document/vite","document/20.vite",[736],{"title":732,"path":737,"stem":738,"children":739,"icon":41},"/document/vite/guide","document/20.vite/01.guide/01.index",[740,742,746,750,754,758],{"title":741,"path":737,"stem":738},"Vite 简介与安装",{"title":743,"path":744,"stem":745},"基础配置","/document/vite/guide/config","document/20.vite/01.guide/02.config",{"title":747,"path":748,"stem":749},"常用插件","/document/vite/guide/plugins","document/20.vite/01.guide/03.plugins",{"title":751,"path":752,"stem":753},"环境变量与模式","/document/vite/guide/env","document/20.vite/01.guide/04.env",{"title":755,"path":756,"stem":757},"依赖预构建","/document/vite/guide/optimize-deps","document/20.vite/01.guide/05.optimize-deps",{"title":759,"path":760,"stem":761},"构建与部署","/document/vite/guide/build-deploy","document/20.vite/01.guide/06.build-deploy",{"title":763,"path":764,"stem":765,"children":766,"page":50},"Nuxt","/document/nuxt","document/21.nuxt",[767],{"title":768,"path":769,"stem":770,"children":771,"icon":41},"Nuxt.js","/document/nuxt/guide","document/21.nuxt/01.guide/01.index",[772,774,778,782,786,790],{"title":773,"path":769,"stem":770},"Nuxt.js 简介与安装",{"title":775,"path":776,"stem":777},"目录约定与自动导入","/document/nuxt/guide/directory-and-auto-imports","document/21.nuxt/01.guide/02.directory-and-auto-imports",{"title":779,"path":780,"stem":781},"文件路由与导航","/document/nuxt/guide/routing","document/21.nuxt/01.guide/03.routing",{"title":783,"path":784,"stem":785},"数据获取","/document/nuxt/guide/data-fetching","document/21.nuxt/01.guide/04.data-fetching",{"title":787,"path":788,"stem":789},"状态管理","/document/nuxt/guide/state-management","document/21.nuxt/01.guide/05.state-management",{"title":791,"path":792,"stem":793},"配置与部署","/document/nuxt/guide/config-and-deploy","document/21.nuxt/01.guide/06.config-and-deploy",{"title":795,"path":796,"stem":797,"children":798,"page":50},"Npm","/document/npm","document/22.npm",[799],{"title":800,"path":801,"stem":802,"children":803,"icon":830},"NPM","/document/npm/guide","document/22.npm/01.guide/01.index",[804,806,810,814,818,822,826],{"title":805,"path":801,"stem":802},"NPM 入门",{"title":807,"path":808,"stem":809},"package.json 详解","/document/npm/guide/package-json","document/22.npm/01.guide/02.package-json",{"title":811,"path":812,"stem":813},"安装命令与版本","/document/npm/guide/install-commands","document/22.npm/01.guide/03.install-commands",{"title":815,"path":816,"stem":817},"scripts 与 npx","/document/npm/guide/scripts-and-npx","document/22.npm/01.guide/04.scripts-and-npx",{"title":819,"path":820,"stem":821},"发布包与镜像源","/document/npm/guide/publish-and-registry","document/22.npm/01.guide/05.publish-and-registry",{"title":823,"path":824,"stem":825},"lock 文件与清理","/document/npm/guide/lock-and-clean","document/22.npm/01.guide/06.lock-and-clean",{"title":827,"path":828,"stem":829},"Yarn 与 pnpm","/document/npm/guide/yarn-and-pnpm","document/22.npm/01.guide/07.yarn-and-pnpm","i-simple-icons-npm",{"title":832,"icon":833,"path":834,"stem":835,"children":836,"page":50},"Handlebars","i-simple-icons-handlebarsdotjs","/document/handlebars","document/23.handlebars",[837],{"title":838,"path":839,"stem":840,"children":841},"Handlebars 简介","/document/handlebars/guide","document/23.handlebars/01.guide/01.index",[842,843,847,851,855,859],{"title":838,"path":839,"stem":840},{"title":844,"path":845,"stem":846},"基本语法","/document/handlebars/guide/syntax","document/23.handlebars/01.guide/02.syntax",{"title":848,"path":849,"stem":850},"内置辅助函数","/document/handlebars/guide/builtins","document/23.handlebars/01.guide/03.builtins",{"title":852,"path":853,"stem":854},"模板复用","/document/handlebars/guide/partials","document/23.handlebars/01.guide/04.partials",{"title":856,"path":857,"stem":858},"自定义 Helpers","/document/handlebars/guide/helpers","document/23.handlebars/01.guide/05.helpers",{"title":860,"path":861,"stem":862},"预编译与运行时","/document/handlebars/guide/runtime","document/23.handlebars/01.guide/06.runtime",{"title":864,"icon":865,"path":866,"stem":867,"children":868,"page":50},"Plop","i-simple-icons-nodedotjs","/document/plop","document/24.plop",[869],{"title":870,"path":871,"stem":872,"children":873},"Plop 简介","/document/plop/guide","document/24.plop/01.guide/01.index",[874,875,879,883,887,891,895],{"title":870,"path":871,"stem":872},{"title":876,"path":877,"stem":878},"第一个生成器","/document/plop/guide/plopfile","document/24.plop/01.guide/02.plopfile",{"title":880,"path":881,"stem":882},"交互式询问","/document/plop/guide/prompts","document/24.plop/01.guide/03.prompts",{"title":884,"path":885,"stem":886},"核心动作","/document/plop/guide/actions","document/24.plop/01.guide/04.actions",{"title":888,"path":889,"stem":890},"模板文件组织","/document/plop/guide/templates","document/24.plop/01.guide/05.templates",{"title":892,"path":893,"stem":894},"Helper 扩展","/document/plop/guide/helpers","document/24.plop/01.guide/06.helpers",{"title":896,"path":897,"stem":898},"组件生成实战","/document/plop/guide/practice","document/24.plop/01.guide/07.practice",{"title":900,"icon":901,"path":902,"stem":903,"children":904,"page":50},"Rollup","i-simple-icons-rollupdotjs","/document/rollup","document/25.rollup",[905],{"title":906,"path":907,"stem":908,"children":909},"Rollup 简介","/document/rollup/guide","document/25.rollup/01.guide/01.index",[910,911,914,918,921,925],{"title":906,"path":907,"stem":908},{"title":743,"path":912,"stem":913},"/document/rollup/guide/config","document/25.rollup/01.guide/02.config",{"title":915,"path":916,"stem":917},"输出格式","/document/rollup/guide/formats","document/25.rollup/01.guide/03.formats",{"title":747,"path":919,"stem":920},"/document/rollup/guide/plugins","document/25.rollup/01.guide/04.plugins",{"title":922,"path":923,"stem":924},"Tree Shaking","/document/rollup/guide/tree-shaking","document/25.rollup/01.guide/05.tree-shaking",{"title":926,"path":927,"stem":928},"打包工具库实战","/document/rollup/guide/library","document/25.rollup/01.guide/06.library",{"title":930,"icon":865,"path":931,"stem":932,"children":933,"page":50},"Snabbdom","/document/snabbdom","document/26.snabbdom",[934],{"title":935,"path":936,"stem":937,"children":938},"Snabbdom 简介","/document/snabbdom/guide","document/26.snabbdom/01.guide/01.index",[939,940,944,948,952,956,960],{"title":935,"path":936,"stem":937},{"title":941,"path":942,"stem":943},"h 函数","/document/snabbdom/guide/h","document/26.snabbdom/01.guide/02.h",{"title":945,"path":946,"stem":947},"模块机制","/document/snabbdom/guide/modules","document/26.snabbdom/01.guide/03.modules",{"title":949,"path":950,"stem":951},"patch 渲染与更新","/document/snabbdom/guide/patch","document/26.snabbdom/01.guide/04.patch",{"title":953,"path":954,"stem":955},"key 的作用","/document/snabbdom/guide/key","document/26.snabbdom/01.guide/05.key",{"title":957,"path":958,"stem":959},"Diff 原理","/document/snabbdom/guide/diff","document/26.snabbdom/01.guide/06.diff",{"title":961,"path":962,"stem":963},"手写迷你虚拟 DOM","/document/snabbdom/guide/practice","document/26.snabbdom/01.guide/07.practice",{"title":965,"icon":966,"path":967,"stem":968,"children":969,"page":50},"Vercel","i-simple-icons-vercel","/document/vercel","document/27.vercel",[970],{"title":971,"path":972,"stem":973,"children":974},"Vercel 简介","/document/vercel/guide","document/27.vercel/01.guide/01.index",[975,976,980,984,988,992,996],{"title":971,"path":972,"stem":973},{"title":977,"path":978,"stem":979},"Vercel CLI","/document/vercel/guide/cli","document/27.vercel/01.guide/02.cli",{"title":981,"path":982,"stem":983},"项目设置与环境变量","/document/vercel/guide/settings","document/27.vercel/01.guide/03.settings",{"title":985,"path":986,"stem":987},"预览部署与回滚","/document/vercel/guide/preview","document/27.vercel/01.guide/04.preview",{"title":989,"path":990,"stem":991},"自定义域名","/document/vercel/guide/domain","document/27.vercel/01.guide/05.domain",{"title":993,"path":994,"stem":995},"vercel.json 配置","/document/vercel/guide/vercel-json","document/27.vercel/01.guide/06.vercel-json",{"title":997,"path":998,"stem":999},"Serverless Functions","/document/vercel/guide/serverless","document/27.vercel/01.guide/07.serverless",{"title":1001,"icon":1002,"path":1003,"stem":1004,"children":1005,"page":50},"ECharts","i-simple-icons-apacheecharts","/document/echarts","document/28.echarts",[1006],{"title":1007,"path":1008,"stem":1009,"children":1010},"ECharts 简介","/document/echarts/guide","document/28.echarts/01.guide/01.index",[1011,1012,1016,1020,1024,1028,1032],{"title":1007,"path":1008,"stem":1009},{"title":1013,"path":1014,"stem":1015},"核心配置项","/document/echarts/guide/option","document/28.echarts/01.guide/02.option",{"title":1017,"path":1018,"stem":1019},"常用图表类型","/document/echarts/guide/charts","document/28.echarts/01.guide/03.charts",{"title":1021,"path":1022,"stem":1023},"样式与主题","/document/echarts/guide/style","document/28.echarts/01.guide/04.style",{"title":1025,"path":1026,"stem":1027},"交互与事件","/document/echarts/guide/interaction","document/28.echarts/01.guide/05.interaction",{"title":1029,"path":1030,"stem":1031},"动态数据","/document/echarts/guide/data","document/28.echarts/01.guide/06.data",{"title":1033,"path":1034,"stem":1035},"Vue3 实战","/document/echarts/guide/vue","document/28.echarts/01.guide/07.vue",{"title":1037,"icon":1038,"path":1039,"stem":1040,"children":1041,"page":50},"D3","i-simple-icons-d3dotjs","/document/d3","document/29.d3",[1042],{"title":1043,"path":1044,"stem":1045,"children":1046},"D3 简介","/document/d3/guide","document/29.d3/01.guide/01.index",[1047,1048,1052,1056,1060,1064,1068,1072],{"title":1043,"path":1044,"stem":1045},{"title":1049,"path":1050,"stem":1051},"选择集与数据绑定","/document/d3/guide/selection","document/29.d3/01.guide/02.selection",{"title":1053,"path":1054,"stem":1055},"比例尺","/document/d3/guide/scale","document/29.d3/01.guide/03.scale",{"title":1057,"path":1058,"stem":1059},"坐标轴","/document/d3/guide/axis","document/29.d3/01.guide/04.axis",{"title":1061,"path":1062,"stem":1063},"图形生成器","/document/d3/guide/shape","document/29.d3/01.guide/05.shape",{"title":1065,"path":1066,"stem":1067},"过渡动画","/document/d3/guide/transition","document/29.d3/01.guide/06.transition",{"title":1069,"path":1070,"stem":1071},"交互与缩放","/document/d3/guide/interaction","document/29.d3/01.guide/07.interaction",{"title":1033,"path":1073,"stem":1074},"/document/d3/guide/vue","document/29.d3/01.guide/08.vue",{"title":1076,"icon":1077,"path":1078,"stem":1079,"children":1080,"page":50},"Three.js","i-simple-icons-threedotjs","/document/threejs","document/30.threejs",[1081],{"title":1082,"path":1083,"stem":1084,"children":1085},"Three.js 简介","/document/threejs/guide","document/30.threejs/01.guide/01.index",[1086,1087,1091,1095,1099,1103,1107],{"title":1082,"path":1083,"stem":1084},{"title":1088,"path":1089,"stem":1090},"几何体与材质","/document/threejs/guide/geometry","document/30.threejs/01.guide/02.geometry",{"title":1092,"path":1093,"stem":1094},"灯光与阴影","/document/threejs/guide/light","document/30.threejs/01.guide/03.light",{"title":1096,"path":1097,"stem":1098},"相机与坐标系","/document/threejs/guide/camera","document/30.threejs/01.guide/04.camera",{"title":1100,"path":1101,"stem":1102},"动画与渲染循环","/document/threejs/guide/animation","document/30.threejs/01.guide/05.animation",{"title":1104,"path":1105,"stem":1106},"轨道控制器","/document/threejs/guide/control","document/30.threejs/01.guide/06.control",{"title":1033,"path":1108,"stem":1109},"/document/threejs/guide/vue","document/30.threejs/01.guide/07.vue",{"title":1111,"icon":865,"path":1112,"stem":1113,"children":1114,"page":50},"Node.js","/document/nodejs","document/32.nodejs",[1115],{"title":1116,"path":1117,"stem":1118,"children":1119},"Node.js 简介","/document/nodejs/guide","document/32.nodejs/01.guide/01.index",[1120,1121,1125,1129,1133,1137,1141,1145],{"title":1116,"path":1117,"stem":1118},{"title":1122,"path":1123,"stem":1124},"模块化","/document/nodejs/guide/module","document/32.nodejs/01.guide/02.module",{"title":1126,"path":1127,"stem":1128},"fs 文件系统","/document/nodejs/guide/fs","document/32.nodejs/01.guide/03.fs",{"title":1130,"path":1131,"stem":1132},"path 路径模块","/document/nodejs/guide/path","document/32.nodejs/01.guide/04.path",{"title":1134,"path":1135,"stem":1136},"http 搭建服务器","/document/nodejs/guide/http","document/32.nodejs/01.guide/05.http",{"title":1138,"path":1139,"stem":1140},"事件循环","/document/nodejs/guide/event-loop","document/32.nodejs/01.guide/06.event-loop",{"title":1142,"path":1143,"stem":1144},"process 与环境变量","/document/nodejs/guide/process","document/32.nodejs/01.guide/07.process",{"title":1146,"path":1147,"stem":1148},"events 事件模块","/document/nodejs/guide/events","document/32.nodejs/01.guide/08.events",{"title":1150,"icon":1151,"path":1152,"stem":1153,"children":1154,"page":50},"Express","i-simple-icons-express","/document/express","document/33.express",[1155],{"title":1156,"path":1157,"stem":1158,"children":1159},"Express 简介","/document/express/guide","document/33.express/01.guide/01.index",[1160,1161,1165,1169,1173,1177],{"title":1156,"path":1157,"stem":1158},{"title":1162,"path":1163,"stem":1164},"路由","/document/express/guide/routing","document/33.express/01.guide/02.routing",{"title":1166,"path":1167,"stem":1168},"中间件","/document/express/guide/middleware","document/33.express/01.guide/03.middleware",{"title":1170,"path":1171,"stem":1172},"请求与响应","/document/express/guide/request-response","document/33.express/01.guide/04.request-response",{"title":1174,"path":1175,"stem":1176},"错误处理","/document/express/guide/error-handling","document/33.express/01.guide/05.error-handling",{"title":1178,"path":1179,"stem":1180},"RESTful 实战","/document/express/guide/restful-api","document/33.express/01.guide/06.restful-api",{"title":1182,"icon":1183,"path":1184,"stem":1185,"children":1186,"page":50},"Koa","i-simple-icons-koa","/document/koa","document/34.koa",[1187],{"title":1188,"path":1189,"stem":1190,"children":1191},"Koa 简介","/document/koa/guide","document/34.koa/01.guide/01.index",[1192,1193,1197,1201,1204,1208],{"title":1188,"path":1189,"stem":1190},{"title":1194,"path":1195,"stem":1196},"Context 上下文","/document/koa/guide/context","document/34.koa/01.guide/02.context",{"title":1198,"path":1199,"stem":1200},"中间件与洋葱模型","/document/koa/guide/middleware","document/34.koa/01.guide/03.middleware",{"title":1162,"path":1202,"stem":1203},"/document/koa/guide/routing","document/34.koa/01.guide/04.routing",{"title":1205,"path":1206,"stem":1207},"请求体与错误处理","/document/koa/guide/body-and-error","document/34.koa/01.guide/05.body-and-error",{"title":1209,"path":1210,"stem":1211},"RESTful 接口实战","/document/koa/guide/restful-api","document/34.koa/01.guide/06.restful-api",{"title":1213,"icon":1214,"path":1215,"stem":1216,"children":1217,"page":50},"Egg.js","i-lucide-egg","/document/egg","document/35.egg",[1218],{"title":1219,"path":1220,"stem":1221,"children":1222},"Egg.js 简介","/document/egg/guide","document/35.egg/01.guide/01.index",[1223,1224,1228,1232,1236,1240],{"title":1219,"path":1220,"stem":1221},{"title":1225,"path":1226,"stem":1227},"路由与 Controller","/document/egg/guide/router-controller","document/35.egg/01.guide/02.router-controller",{"title":1229,"path":1230,"stem":1231},"Service 业务逻辑","/document/egg/guide/service","document/35.egg/01.guide/03.service",{"title":1233,"path":1234,"stem":1235},"配置与中间件","/document/egg/guide/config-middleware","document/35.egg/01.guide/04.config-middleware",{"title":1237,"path":1238,"stem":1239},"插件与扩展","/document/egg/guide/plugin-extend","document/35.egg/01.guide/05.plugin-extend",{"title":1209,"path":1241,"stem":1242},"/document/egg/guide/restful-api","document/35.egg/01.guide/06.restful-api",{"title":1244,"icon":1245,"path":1246,"stem":1247,"children":1248,"page":50},"Docker","i-simple-icons-docker","/document/docker","document/36.docker",[1249],{"title":1250,"path":1251,"stem":1252,"children":1253},"Docker 简介","/document/docker/guide","document/36.docker/01.guide/01.index",[1254,1255,1259,1263,1267],{"title":1250,"path":1251,"stem":1252},{"title":1256,"path":1257,"stem":1258},"镜像与容器","/document/docker/guide/image-container","document/36.docker/01.guide/02.image-container",{"title":1260,"path":1261,"stem":1262},"数据卷","/document/docker/guide/volume","document/36.docker/01.guide/03.volume",{"title":1264,"path":1265,"stem":1266},"Dockerfile","/document/docker/guide/dockerfile","document/36.docker/01.guide/04.dockerfile",{"title":1268,"path":1269,"stem":1270},"Docker Compose","/document/docker/guide/docker-compose","document/36.docker/01.guide/05.docker-compose",{"title":1272,"icon":1273,"path":1274,"stem":1275,"children":1276,"page":50},"MySQL","i-simple-icons-mysql","/document/mysql","document/37.mysql",[1277],{"title":1278,"path":1279,"stem":1280,"children":1281},"MySQL 简介","/document/mysql/guide","document/37.mysql/01.guide/01.index",[1282,1283,1287,1291,1295,1299,1303],{"title":1278,"path":1279,"stem":1280},{"title":1284,"path":1285,"stem":1286},"增删改查","/document/mysql/guide/crud","document/37.mysql/01.guide/02.crud",{"title":1288,"path":1289,"stem":1290},"条件查询与分页","/document/mysql/guide/query","document/37.mysql/01.guide/03.query",{"title":1292,"path":1293,"stem":1294},"数据类型与约束","/document/mysql/guide/data-type","document/37.mysql/01.guide/04.data-type",{"title":1296,"path":1297,"stem":1298},"多表关联查询","/document/mysql/guide/join","document/37.mysql/01.guide/05.join",{"title":1300,"path":1301,"stem":1302},"Node.js 操作 MySQL","/document/mysql/guide/nodejs","document/37.mysql/01.guide/06.nodejs",{"title":1304,"path":1305,"stem":1306},"索引与优化","/document/mysql/guide/optimize","document/37.mysql/01.guide/07.optimize",{"title":1308,"icon":1309,"path":1310,"stem":1311,"children":1312,"page":50},"MongoDB","i-simple-icons-mongodb","/document/mongodb","document/38.mongodb",[1313],{"title":1314,"path":1315,"stem":1316,"children":1317},"MongoDB 简介","/document/mongodb/guide","document/38.mongodb/01.guide/01.index",[1318,1319,1322,1326,1330,1334,1338,1342],{"title":1314,"path":1315,"stem":1316},{"title":1284,"path":1320,"stem":1321},"/document/mongodb/guide/crud","document/38.mongodb/01.guide/02.crud",{"title":1323,"path":1324,"stem":1325},"条件查询","/document/mongodb/guide/query","document/38.mongodb/01.guide/03.query",{"title":1327,"path":1328,"stem":1329},"文档与数据类型","/document/mongodb/guide/document","document/38.mongodb/01.guide/04.document",{"title":1331,"path":1332,"stem":1333},"Node.js 操作 MongoDB","/document/mongodb/guide/nodejs","document/38.mongodb/01.guide/05.nodejs",{"title":1335,"path":1336,"stem":1337},"Mongoose","/document/mongodb/guide/mongoose","document/38.mongodb/01.guide/06.mongoose",{"title":1339,"path":1340,"stem":1341},"索引","/document/mongodb/guide/optimize","document/38.mongodb/01.guide/07.optimize",{"title":1343,"path":1344,"stem":1345},"聚合管道","/document/mongodb/guide/aggregate","document/38.mongodb/01.guide/08.aggregate",{"title":1347,"icon":1348,"path":1349,"stem":1350,"children":1351,"page":50},"GraphQL","i-simple-icons-graphql","/document/graphql","document/39.graphql",[1352],{"title":1353,"path":1354,"stem":1355,"children":1356},"GraphQL 简介","/document/graphql/guide","document/39.graphql/01.guide/01.index",[1357,1358,1362,1366,1370,1374],{"title":1353,"path":1354,"stem":1355},{"title":1359,"path":1360,"stem":1361},"类型系统","/document/graphql/guide/schema","document/39.graphql/01.guide/02.schema",{"title":1363,"path":1364,"stem":1365},"查询进阶","/document/graphql/guide/query","document/39.graphql/01.guide/03.query",{"title":1367,"path":1368,"stem":1369},"Mutation 增删改","/document/graphql/guide/mutation","document/39.graphql/01.guide/04.mutation",{"title":1371,"path":1372,"stem":1373},"Express 集成","/document/graphql/guide/express","document/39.graphql/01.guide/05.express",{"title":1375,"path":1376,"stem":1377},"前端调用","/document/graphql/guide/client","document/39.graphql/01.guide/06.client",{"title":1379,"icon":1380,"path":1381,"stem":1382,"children":1383,"page":50},"Vue2 源码","i-simple-icons-vuedotjs","/document/source-vue2","document/40.source-vue2",[1384],{"title":1385,"path":1386,"stem":1387,"children":1388},"Vue2 源码简介","/document/source-vue2/guide","document/40.source-vue2/01.guide/01.index",[1389,1390,1394,1398,1402,1406,1410,1414],{"title":1385,"path":1386,"stem":1387},{"title":1391,"path":1392,"stem":1393},"初始化流程","/document/source-vue2/guide/init","document/40.source-vue2/01.guide/02.init",{"title":1395,"path":1396,"stem":1397},"响应式原理","/document/source-vue2/guide/reactive","document/40.source-vue2/01.guide/03.reactive",{"title":1399,"path":1400,"stem":1401},"Dep 与 Watcher","/document/source-vue2/guide/dep-watcher","document/40.source-vue2/01.guide/04.dep-watcher",{"title":1403,"path":1404,"stem":1405},"异步更新与 nextTick","/document/source-vue2/guide/nexttick","document/40.source-vue2/01.guide/05.nexttick",{"title":1407,"path":1408,"stem":1409},"虚拟 DOM 与 patch","/document/source-vue2/guide/vnode-patch","document/40.source-vue2/01.guide/06.vnode-patch",{"title":1411,"path":1412,"stem":1413},"模板编译","/document/source-vue2/guide/compile","document/40.source-vue2/01.guide/07.compile",{"title":1415,"path":1416,"stem":1417},"computed 与 watch 原理","/document/source-vue2/guide/computed-watch","document/40.source-vue2/01.guide/08.computed-watch",{"title":1419,"icon":1380,"path":1420,"stem":1421,"children":1422,"page":50},"Vue3 源码","/document/source-vue3","document/41.source-vue3",[1423],{"title":1424,"path":1425,"stem":1426,"children":1427},"Vue3 源码简介","/document/source-vue3/guide","document/41.source-vue3/01.guide/01.index",[1428,1429,1433,1437,1441,1445,1449,1452],{"title":1424,"path":1425,"stem":1426},{"title":1430,"path":1431,"stem":1432},"创建与挂载","/document/source-vue3/guide/create-app","document/41.source-vue3/01.guide/02.create-app",{"title":1434,"path":1435,"stem":1436},"Proxy 响应式","/document/source-vue3/guide/reactive","document/41.source-vue3/01.guide/03.reactive",{"title":1438,"path":1439,"stem":1440},"effect 与依赖收集","/document/source-vue3/guide/effect","document/41.source-vue3/01.guide/04.effect",{"title":1442,"path":1443,"stem":1444},"ref 与 computed","/document/source-vue3/guide/ref-computed","document/41.source-vue3/01.guide/05.ref-computed",{"title":1446,"path":1447,"stem":1448},"调度器与 nextTick","/document/source-vue3/guide/scheduler-nexttick","document/41.source-vue3/01.guide/06.scheduler-nexttick",{"title":1407,"path":1450,"stem":1451},"/document/source-vue3/guide/vnode-patch","document/41.source-vue3/01.guide/07.vnode-patch",{"title":1411,"path":1453,"stem":1454},"/document/source-vue3/guide/compile","document/41.source-vue3/01.guide/08.compile",{"title":1456,"icon":1457,"path":1458,"stem":1459,"children":1460,"page":50},"性能优化","i-lucide-zap","/document/performance","document/42.performance",[1461],{"title":1462,"path":1463,"stem":1464,"children":1465},"性能优化简介","/document/performance/guide","document/42.performance/01.guide/01.index",[1466,1467,1471,1475,1479,1483],{"title":1462,"path":1463,"stem":1464},{"title":1468,"path":1469,"stem":1470},"加载优化","/document/performance/guide/loading","document/42.performance/01.guide/02.loading",{"title":1472,"path":1473,"stem":1474},"渲染优化","/document/performance/guide/rendering","document/42.performance/01.guide/03.rendering",{"title":1476,"path":1477,"stem":1478},"缓存策略","/document/performance/guide/cache","document/42.performance/01.guide/04.cache",{"title":1480,"path":1481,"stem":1482},"构建产物优化","/document/performance/guide/build","document/42.performance/01.guide/05.build",{"title":1484,"path":1485,"stem":1486},"性能指标与工具","/document/performance/guide/metrics","document/42.performance/01.guide/06.metrics",{"title":1488,"icon":1489,"path":1490,"stem":1491,"children":1492,"page":50},"前端监控","i-lucide-activity","/document/monitor","document/43.monitor",[1493],{"title":1494,"path":1495,"stem":1496,"children":1497},"前端监控简介","/document/monitor/guide","document/43.monitor/01.guide/01.index",[1498,1499,1503,1507,1511,1515],{"title":1494,"path":1495,"stem":1496},{"title":1500,"path":1501,"stem":1502},"错误采集","/document/monitor/guide/error","document/43.monitor/01.guide/02.error",{"title":1504,"path":1505,"stem":1506},"埋点与上报","/document/monitor/guide/tracking","document/43.monitor/01.guide/03.tracking",{"title":1508,"path":1509,"stem":1510},"性能数据上报","/document/monitor/guide/performance-data","document/43.monitor/01.guide/04.performance-data",{"title":1512,"path":1513,"stem":1514},"Sentry 实践","/document/monitor/guide/sentry","document/43.monitor/01.guide/05.sentry",{"title":1516,"path":1517,"stem":1518},"日志与告警","/document/monitor/guide/logging","document/43.monitor/01.guide/06.logging",{"title":1520,"icon":1521,"path":1522,"stem":1523,"children":1524},"Electron：从入门到桌面应用交付","i-simple-icons-electron","/document/electron","document/44.electron/课程规划",[1525,1541,1559,1577,1595],{"title":1526,"path":1527,"stem":1528,"children":1529,"icon":1540},"基础架构","/document/electron/guide","document/44.electron/01.guide/01.index",[1530,1532,1536],{"title":1531,"path":1527,"stem":1528},"Electron 简介",{"title":1533,"path":1534,"stem":1535},"主进程、渲染进程与 preload","/document/electron/guide/process-model","document/44.electron/01.guide/02.process-model",{"title":1537,"path":1538,"stem":1539},"Electron 与 Vue 集成","/document/electron/guide/vue-integration","document/44.electron/01.guide/03.vue-integration","i-lucide-layers",{"title":1542,"icon":1543,"path":1544,"stem":1545,"children":1546,"page":50},"核心开发","i-lucide-code-2","/document/electron/core","document/44.electron/02.core",[1547,1551,1555],{"title":1548,"path":1549,"stem":1550},"创建窗口与应用生命周期","/document/electron/core/window-lifecycle","document/44.electron/02.core/04.window-lifecycle",{"title":1552,"path":1553,"stem":1554},"IPC 通信与接口设计","/document/electron/core/ipc-design","document/44.electron/02.core/05.ipc-design",{"title":1556,"path":1557,"stem":1558},"本地文件与系统交互","/document/electron/core/filesystem-system","document/44.electron/02.core/06.filesystem-system",{"title":1560,"icon":1561,"path":1562,"stem":1563,"children":1564,"page":50},"桌面能力与安全","i-lucide-monitor-cog","/document/electron/desktop","document/44.electron/03.desktop",[1565,1569,1573],{"title":1566,"path":1567,"stem":1568},"桌面端安全基础","/document/electron/desktop/security","document/44.electron/03.desktop/07.security",{"title":1570,"path":1571,"stem":1572},"菜单、托盘与多窗口","/document/electron/desktop/window-menu-tray","document/44.electron/03.desktop/08.window-menu-tray",{"title":1574,"path":1575,"stem":1576},"会话、网络与本地存储","/document/electron/desktop/session-storage","document/44.electron/03.desktop/09.session-storage",{"title":1578,"icon":1579,"path":1580,"stem":1581,"children":1582,"page":50},"资源、性能与导出","i-lucide-gauge","/document/electron/stability","document/44.electron/04.stability",[1583,1587,1591],{"title":1584,"path":1585,"stem":1586},"自定义协议、资源加载与深链接","/document/electron/stability/protocol-loading","document/44.electron/04.stability/10.protocol-loading",{"title":1588,"path":1589,"stem":1590},"耗时任务与性能排查","/document/electron/stability/tasks-performance","document/44.electron/04.stability/11.tasks-performance",{"title":1592,"path":1593,"stem":1594},"PDF 打印与报告导出","/document/electron/stability/pdf-report","document/44.electron/04.stability/12.pdf-report",{"title":1596,"icon":1597,"path":1598,"stem":1599,"children":1600,"page":50},"交付与实战","i-lucide-rocket","/document/electron/delivery","document/44.electron/05.delivery",[1601,1605,1609,1613],{"title":1602,"path":1603,"stem":1604},"应用打包与自动更新","/document/electron/delivery/package-update","document/44.electron/05.delivery/13.package-update",{"title":1606,"path":1607,"stem":1608},"桌面应用签名与公证","/document/electron/delivery/code-signing","document/44.electron/05.delivery/14.code-signing",{"title":1610,"path":1611,"stem":1612},"测试、监控与发布","/document/electron/delivery/test-monitor-release","document/44.electron/05.delivery/15.test-monitor-release",{"title":1614,"path":1615,"stem":1616},"实战：桌面资料管理工具","/document/electron/delivery/project-file-manager","document/44.electron/05.delivery/16.project-file-manager",{"id":1618,"title":1619,"body":1620,"description":3525,"extension":3526,"links":3527,"meta":3528,"navigation":3529,"path":1534,"seo":3530,"stem":1535,"__hash__":3531},"docs/document/44.electron/01.guide/02.process-model.md","Electron 主进程、渲染进程与 preload",{"type":1621,"value":1622,"toc":3516},"minimal",[1623,1628,1645,1648,1651,1667,1670,1674,1689,1699,1704,1765,1775,1777,1781,1784,1787,2550,2556,2559,2854,2857,3130,3133,3149,3155,3158,3160,3170,3172,3176,3179,3198,3204,3258,3261,3300,3303,3305,3309,3331,3333,3337,3342,3348,3353,3356,3361,3364,3369,3375,3380,3383,3385,3389,3395,3457,3463,3504,3507,3509,3512],[1624,1625,1627],"h2",{"id":1626},"引言","🎯 引言",[1629,1630,1631,1632,1636,1637,1640,1641,1644],"p",{},"Electron 应用不是把所有代码都放在同一个环境中运行。管理窗口和调用系统能力的代码运行在",[1633,1634,1635],"strong",{},"主进程","，页面代码运行在",[1633,1638,1639],{},"渲染进程","，两者之间还可以通过",[1633,1642,1643],{},"预加载脚本","建立安全的通信入口。",[1629,1646,1647],{},"本篇只解决一个问题：不同代码应该运行在哪个进程。窗口的详细生命周期会在下一篇之后单独讲解。",[1629,1649,1650],{},"学完本篇，你将能够：",[1652,1653,1654,1658,1661,1664],"ul",{},[1655,1656,1657],"li",{},"区分主进程、渲染进程和预加载脚本的职责。",[1655,1659,1660],{},"理解一个主进程如何管理多个窗口。",[1655,1662,1663],{},"观察不同窗口拥有独立的页面状态。",[1655,1665,1666],{},"为下一篇接入 Vue 和后续 IPC 学习建立清晰的进程边界。",[1668,1669],"hr",{},[1624,1671,1673],{"id":1672},"electron-的进程模型","🧱 Electron 的进程模型",[1629,1675,1676,1677,1681,1682,1685,1686,1688],{},"Electron 应用启动时会先运行 ",[1678,1679,1680],"code",{},"package.json"," 中 ",[1678,1683,1684],{},"main"," 指向的文件，这段代码所在的环境就是",[1633,1687,1635],{},"。一个应用只有一个主进程，它负责管理整个应用。",[1629,1690,1691,1692,1695,1696,1698],{},"主进程使用 ",[1678,1693,1694],{},"BrowserWindow"," 创建窗口。窗口加载 HTML 后，页面代码会在",[1633,1697,1639],{},"中运行。开发时可以把每个窗口看成一个独立的浏览器页面：它们拥有自己的 DOM 和 JavaScript 变量，不会自动共享页面状态。",[1629,1700,1701,1703],{},[1633,1702,1643],{},"会在页面脚本之前运行。它负责向渲染进程提供少量、明确的桌面能力，本篇先认识它的位置，具体用法会在 IPC 章节讲解。",[1705,1706,1707,1723],"table",{},[1708,1709,1710],"thead",{},[1711,1712,1713,1717,1720],"tr",{},[1714,1715,1716],"th",{},"运行环境",[1714,1718,1719],{},"主要职责",[1714,1721,1722],{},"常见内容",[1724,1725,1726,1742,1752],"tbody",{},[1711,1727,1728,1731,1734],{},[1729,1730,1635],"td",{},[1729,1732,1733],{},"管理应用、窗口和系统能力",[1729,1735,1736,1739,1740],{},[1678,1737,1738],{},"app","、",[1678,1741,1694],{},[1711,1743,1744,1746,1749],{},[1729,1745,1639],{},[1729,1747,1748],{},"显示页面并处理界面交互",[1729,1750,1751],{},"HTML、CSS、DOM、页面脚本",[1711,1753,1754,1756,1759],{},[1729,1755,1643],{},[1729,1757,1758],{},"安全地向页面暴露有限的桌面能力",[1729,1760,1761,1764],{},[1678,1762,1763],{},"contextBridge","、受限 IPC API",[1766,1767,1768],"warning",{},[1629,1769,1770,1771,1774],{},"不要为了让页面直接使用 Node.js API 而开启 ",[1678,1772,1773],{},"nodeIntegration","。保留 Electron 的默认隔离设置，再通过预加载脚本暴露必要能力。",[1668,1776],{},[1624,1778,1780],{"id":1779},"创建两个独立的页面环境","🛠 创建两个独立的页面环境",[1629,1782,1783],{},"下面由一个主进程创建两个窗口。两个窗口加载相同的 HTML 和 JavaScript，但各自保存一份独立的计数器状态。",[1629,1785,1786],{},"先创建主进程入口：",[1788,1789,1795],"pre",{"className":1790,"code":1791,"filename":1792,"language":1793,"meta":1794,"style":1794},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const { app, BrowserWindow } = require('electron');\nconst path = require('node:path');\n\nconst windows = new Set();\n\nfunction createWindow(name) {\n    const win = new BrowserWindow({\n        width: 460,\n        height: 360,\n        title: name,\n    });\n\n    windows.add(win);\n    win.loadFile(path.join(__dirname, 'index.html'), {\n        query: { name },\n    });\n\n    win.on('closed', () => {\n        windows.delete(win);\n    });\n\n    return win;\n}\n\nfunction createApplicationWindows() {\n    const firstWindow = createWindow('窗口 A');\n    const secondWindow = createWindow('窗口 B');\n    const [x, y] = firstWindow.getPosition();\n\n    secondWindow.setPosition(x + 60, y + 60);\n}\n\napp.whenReady().then(() => {\n    createApplicationWindows();\n\n    app.on('activate', () => {\n        if (BrowserWindow.getAllWindows().length === 0) {\n            createApplicationWindows();\n        }\n    });\n});\n\napp.on('window-all-closed', () => {\n    if (process.platform !== 'darwin') {\n        app.quit();\n    }\n});\n","main.js","js","",[1678,1796,1797,1848,1874,1881,1902,1907,1927,1949,1965,1978,1991,2001,2006,2027,2069,2084,2093,2098,2127,2146,2155,2160,2171,2177,2182,2194,2219,2244,2276,2281,2314,2319,2324,2349,2359,2364,2391,2425,2435,2441,2450,2459,2464,2490,2520,2535,2541],{"__ignoreMap":1794},[1798,1799,1802,1806,1810,1814,1817,1820,1823,1826,1830,1833,1836,1840,1842,1845],"span",{"class":1800,"line":1801},"line",1,[1798,1803,1805],{"class":1804},"s50WR","const",[1798,1807,1809],{"class":1808},"s86vT"," {",[1798,1811,1813],{"class":1812},"sndM8"," app",[1798,1815,1816],{"class":1808},",",[1798,1818,1819],{"class":1812}," BrowserWindow ",[1798,1821,1822],{"class":1808},"}",[1798,1824,1825],{"class":1808}," =",[1798,1827,1829],{"class":1828},"swgpB"," require",[1798,1831,1832],{"class":1812},"(",[1798,1834,1835],{"class":1808},"'",[1798,1837,1839],{"class":1838},"sIEYB","electron",[1798,1841,1835],{"class":1808},[1798,1843,1844],{"class":1812},")",[1798,1846,1847],{"class":1808},";\n",[1798,1849,1851,1853,1856,1859,1861,1863,1865,1868,1870,1872],{"class":1800,"line":1850},2,[1798,1852,1805],{"class":1804},[1798,1854,1855],{"class":1812}," path ",[1798,1857,1858],{"class":1808},"=",[1798,1860,1829],{"class":1828},[1798,1862,1832],{"class":1812},[1798,1864,1835],{"class":1808},[1798,1866,1867],{"class":1838},"node:path",[1798,1869,1835],{"class":1808},[1798,1871,1844],{"class":1812},[1798,1873,1847],{"class":1808},[1798,1875,1877],{"class":1800,"line":1876},3,[1798,1878,1880],{"emptyLinePlaceholder":1879},true,"\n",[1798,1882,1884,1886,1889,1891,1894,1897,1900],{"class":1800,"line":1883},4,[1798,1885,1805],{"class":1804},[1798,1887,1888],{"class":1812}," windows ",[1798,1890,1858],{"class":1808},[1798,1892,1893],{"class":1808}," new",[1798,1895,1896],{"class":1828}," Set",[1798,1898,1899],{"class":1812},"()",[1798,1901,1847],{"class":1808},[1798,1903,1905],{"class":1800,"line":1904},5,[1798,1906,1880],{"emptyLinePlaceholder":1879},[1798,1908,1910,1913,1916,1918,1922,1924],{"class":1800,"line":1909},6,[1798,1911,1912],{"class":1804},"function",[1798,1914,1915],{"class":1828}," createWindow",[1798,1917,1832],{"class":1808},[1798,1919,1921],{"class":1920},"sK9QF","name",[1798,1923,1844],{"class":1808},[1798,1925,1926],{"class":1808}," {\n",[1798,1928,1930,1933,1936,1938,1940,1943,1946],{"class":1800,"line":1929},7,[1798,1931,1932],{"class":1804},"    const",[1798,1934,1935],{"class":1812}," win",[1798,1937,1825],{"class":1808},[1798,1939,1893],{"class":1808},[1798,1941,1942],{"class":1828}," BrowserWindow",[1798,1944,1832],{"class":1945},"sd2Uz",[1798,1947,1948],{"class":1808},"{\n",[1798,1950,1952,1955,1958,1962],{"class":1800,"line":1951},8,[1798,1953,1954],{"class":1945},"        width",[1798,1956,1957],{"class":1808},":",[1798,1959,1961],{"class":1960},"smPcV"," 460",[1798,1963,1964],{"class":1808},",\n",[1798,1966,1968,1971,1973,1976],{"class":1800,"line":1967},9,[1798,1969,1970],{"class":1945},"        height",[1798,1972,1957],{"class":1808},[1798,1974,1975],{"class":1960}," 360",[1798,1977,1964],{"class":1808},[1798,1979,1981,1984,1986,1989],{"class":1800,"line":1980},10,[1798,1982,1983],{"class":1945},"        title",[1798,1985,1957],{"class":1808},[1798,1987,1988],{"class":1812}," name",[1798,1990,1964],{"class":1808},[1798,1992,1994,1997,1999],{"class":1800,"line":1993},11,[1798,1995,1996],{"class":1808},"    }",[1798,1998,1844],{"class":1945},[1798,2000,1847],{"class":1808},[1798,2002,2004],{"class":1800,"line":2003},12,[1798,2005,1880],{"emptyLinePlaceholder":1879},[1798,2007,2009,2012,2015,2018,2020,2023,2025],{"class":1800,"line":2008},13,[1798,2010,2011],{"class":1812},"    windows",[1798,2013,2014],{"class":1808},".",[1798,2016,2017],{"class":1828},"add",[1798,2019,1832],{"class":1945},[1798,2021,2022],{"class":1812},"win",[1798,2024,1844],{"class":1945},[1798,2026,1847],{"class":1808},[1798,2028,2030,2033,2035,2038,2040,2043,2045,2048,2050,2053,2055,2058,2061,2063,2065,2067],{"class":1800,"line":2029},14,[1798,2031,2032],{"class":1812},"    win",[1798,2034,2014],{"class":1808},[1798,2036,2037],{"class":1828},"loadFile",[1798,2039,1832],{"class":1945},[1798,2041,2042],{"class":1812},"path",[1798,2044,2014],{"class":1808},[1798,2046,2047],{"class":1828},"join",[1798,2049,1832],{"class":1945},[1798,2051,2052],{"class":1812},"__dirname",[1798,2054,1816],{"class":1808},[1798,2056,2057],{"class":1808}," '",[1798,2059,2060],{"class":1838},"index.html",[1798,2062,1835],{"class":1808},[1798,2064,1844],{"class":1945},[1798,2066,1816],{"class":1808},[1798,2068,1926],{"class":1808},[1798,2070,2072,2075,2077,2079,2081],{"class":1800,"line":2071},15,[1798,2073,2074],{"class":1945},"        query",[1798,2076,1957],{"class":1808},[1798,2078,1809],{"class":1808},[1798,2080,1988],{"class":1812},[1798,2082,2083],{"class":1808}," },\n",[1798,2085,2087,2089,2091],{"class":1800,"line":2086},16,[1798,2088,1996],{"class":1808},[1798,2090,1844],{"class":1945},[1798,2092,1847],{"class":1808},[1798,2094,2096],{"class":1800,"line":2095},17,[1798,2097,1880],{"emptyLinePlaceholder":1879},[1798,2099,2101,2103,2105,2108,2110,2112,2115,2117,2119,2122,2125],{"class":1800,"line":2100},18,[1798,2102,2032],{"class":1812},[1798,2104,2014],{"class":1808},[1798,2106,2107],{"class":1828},"on",[1798,2109,1832],{"class":1945},[1798,2111,1835],{"class":1808},[1798,2113,2114],{"class":1838},"closed",[1798,2116,1835],{"class":1808},[1798,2118,1816],{"class":1808},[1798,2120,2121],{"class":1808}," ()",[1798,2123,2124],{"class":1804}," =>",[1798,2126,1926],{"class":1808},[1798,2128,2130,2133,2135,2138,2140,2142,2144],{"class":1800,"line":2129},19,[1798,2131,2132],{"class":1812},"        windows",[1798,2134,2014],{"class":1808},[1798,2136,2137],{"class":1828},"delete",[1798,2139,1832],{"class":1945},[1798,2141,2022],{"class":1812},[1798,2143,1844],{"class":1945},[1798,2145,1847],{"class":1808},[1798,2147,2149,2151,2153],{"class":1800,"line":2148},20,[1798,2150,1996],{"class":1808},[1798,2152,1844],{"class":1945},[1798,2154,1847],{"class":1808},[1798,2156,2158],{"class":1800,"line":2157},21,[1798,2159,1880],{"emptyLinePlaceholder":1879},[1798,2161,2163,2167,2169],{"class":1800,"line":2162},22,[1798,2164,2166],{"class":2165},"s8pZq","    return",[1798,2168,1935],{"class":1812},[1798,2170,1847],{"class":1808},[1798,2172,2174],{"class":1800,"line":2173},23,[1798,2175,2176],{"class":1808},"}\n",[1798,2178,2180],{"class":1800,"line":2179},24,[1798,2181,1880],{"emptyLinePlaceholder":1879},[1798,2183,2185,2187,2190,2192],{"class":1800,"line":2184},25,[1798,2186,1912],{"class":1804},[1798,2188,2189],{"class":1828}," createApplicationWindows",[1798,2191,1899],{"class":1808},[1798,2193,1926],{"class":1808},[1798,2195,2197,2199,2202,2204,2206,2208,2210,2213,2215,2217],{"class":1800,"line":2196},26,[1798,2198,1932],{"class":1804},[1798,2200,2201],{"class":1812}," firstWindow",[1798,2203,1825],{"class":1808},[1798,2205,1915],{"class":1828},[1798,2207,1832],{"class":1945},[1798,2209,1835],{"class":1808},[1798,2211,2212],{"class":1838},"窗口 A",[1798,2214,1835],{"class":1808},[1798,2216,1844],{"class":1945},[1798,2218,1847],{"class":1808},[1798,2220,2222,2224,2227,2229,2231,2233,2235,2238,2240,2242],{"class":1800,"line":2221},27,[1798,2223,1932],{"class":1804},[1798,2225,2226],{"class":1812}," secondWindow",[1798,2228,1825],{"class":1808},[1798,2230,1915],{"class":1828},[1798,2232,1832],{"class":1945},[1798,2234,1835],{"class":1808},[1798,2236,2237],{"class":1838},"窗口 B",[1798,2239,1835],{"class":1808},[1798,2241,1844],{"class":1945},[1798,2243,1847],{"class":1808},[1798,2245,2247,2249,2252,2255,2257,2260,2263,2265,2267,2269,2272,2274],{"class":1800,"line":2246},28,[1798,2248,1932],{"class":1804},[1798,2250,2251],{"class":1808}," [",[1798,2253,2254],{"class":1812},"x",[1798,2256,1816],{"class":1808},[1798,2258,2259],{"class":1812}," y",[1798,2261,2262],{"class":1808},"]",[1798,2264,1825],{"class":1808},[1798,2266,2201],{"class":1812},[1798,2268,2014],{"class":1808},[1798,2270,2271],{"class":1828},"getPosition",[1798,2273,1899],{"class":1945},[1798,2275,1847],{"class":1808},[1798,2277,2279],{"class":1800,"line":2278},29,[1798,2280,1880],{"emptyLinePlaceholder":1879},[1798,2282,2284,2287,2289,2292,2294,2296,2299,2302,2304,2306,2308,2310,2312],{"class":1800,"line":2283},30,[1798,2285,2286],{"class":1812},"    secondWindow",[1798,2288,2014],{"class":1808},[1798,2290,2291],{"class":1828},"setPosition",[1798,2293,1832],{"class":1945},[1798,2295,2254],{"class":1812},[1798,2297,2298],{"class":1808}," +",[1798,2300,2301],{"class":1960}," 60",[1798,2303,1816],{"class":1808},[1798,2305,2259],{"class":1812},[1798,2307,2298],{"class":1808},[1798,2309,2301],{"class":1960},[1798,2311,1844],{"class":1945},[1798,2313,1847],{"class":1808},[1798,2315,2317],{"class":1800,"line":2316},31,[1798,2318,2176],{"class":1808},[1798,2320,2322],{"class":1800,"line":2321},32,[1798,2323,1880],{"emptyLinePlaceholder":1879},[1798,2325,2327,2329,2331,2334,2336,2338,2341,2343,2345,2347],{"class":1800,"line":2326},33,[1798,2328,1738],{"class":1812},[1798,2330,2014],{"class":1808},[1798,2332,2333],{"class":1828},"whenReady",[1798,2335,1899],{"class":1812},[1798,2337,2014],{"class":1808},[1798,2339,2340],{"class":1828},"then",[1798,2342,1832],{"class":1812},[1798,2344,1899],{"class":1808},[1798,2346,2124],{"class":1804},[1798,2348,1926],{"class":1808},[1798,2350,2352,2355,2357],{"class":1800,"line":2351},34,[1798,2353,2354],{"class":1828},"    createApplicationWindows",[1798,2356,1899],{"class":1945},[1798,2358,1847],{"class":1808},[1798,2360,2362],{"class":1800,"line":2361},35,[1798,2363,1880],{"emptyLinePlaceholder":1879},[1798,2365,2367,2370,2372,2374,2376,2378,2381,2383,2385,2387,2389],{"class":1800,"line":2366},36,[1798,2368,2369],{"class":1812},"    app",[1798,2371,2014],{"class":1808},[1798,2373,2107],{"class":1828},[1798,2375,1832],{"class":1945},[1798,2377,1835],{"class":1808},[1798,2379,2380],{"class":1838},"activate",[1798,2382,1835],{"class":1808},[1798,2384,1816],{"class":1808},[1798,2386,2121],{"class":1808},[1798,2388,2124],{"class":1804},[1798,2390,1926],{"class":1808},[1798,2392,2394,2397,2400,2402,2404,2407,2409,2411,2414,2417,2420,2423],{"class":1800,"line":2393},37,[1798,2395,2396],{"class":2165},"        if",[1798,2398,2399],{"class":1945}," (",[1798,2401,1694],{"class":1812},[1798,2403,2014],{"class":1808},[1798,2405,2406],{"class":1828},"getAllWindows",[1798,2408,1899],{"class":1945},[1798,2410,2014],{"class":1808},[1798,2412,2413],{"class":1812},"length",[1798,2415,2416],{"class":1808}," ===",[1798,2418,2419],{"class":1960}," 0",[1798,2421,2422],{"class":1945},") ",[1798,2424,1948],{"class":1808},[1798,2426,2428,2431,2433],{"class":1800,"line":2427},38,[1798,2429,2430],{"class":1828},"            createApplicationWindows",[1798,2432,1899],{"class":1945},[1798,2434,1847],{"class":1808},[1798,2436,2438],{"class":1800,"line":2437},39,[1798,2439,2440],{"class":1808},"        }\n",[1798,2442,2444,2446,2448],{"class":1800,"line":2443},40,[1798,2445,1996],{"class":1808},[1798,2447,1844],{"class":1945},[1798,2449,1847],{"class":1808},[1798,2451,2453,2455,2457],{"class":1800,"line":2452},41,[1798,2454,1822],{"class":1808},[1798,2456,1844],{"class":1812},[1798,2458,1847],{"class":1808},[1798,2460,2462],{"class":1800,"line":2461},42,[1798,2463,1880],{"emptyLinePlaceholder":1879},[1798,2465,2467,2469,2471,2473,2475,2477,2480,2482,2484,2486,2488],{"class":1800,"line":2466},43,[1798,2468,1738],{"class":1812},[1798,2470,2014],{"class":1808},[1798,2472,2107],{"class":1828},[1798,2474,1832],{"class":1812},[1798,2476,1835],{"class":1808},[1798,2478,2479],{"class":1838},"window-all-closed",[1798,2481,1835],{"class":1808},[1798,2483,1816],{"class":1808},[1798,2485,2121],{"class":1808},[1798,2487,2124],{"class":1804},[1798,2489,1926],{"class":1808},[1798,2491,2493,2496,2498,2501,2503,2506,2509,2511,2514,2516,2518],{"class":1800,"line":2492},44,[1798,2494,2495],{"class":2165},"    if",[1798,2497,2399],{"class":1945},[1798,2499,2500],{"class":1812},"process",[1798,2502,2014],{"class":1808},[1798,2504,2505],{"class":1812},"platform",[1798,2507,2508],{"class":1808}," !==",[1798,2510,2057],{"class":1808},[1798,2512,2513],{"class":1838},"darwin",[1798,2515,1835],{"class":1808},[1798,2517,2422],{"class":1945},[1798,2519,1948],{"class":1808},[1798,2521,2523,2526,2528,2531,2533],{"class":1800,"line":2522},45,[1798,2524,2525],{"class":1812},"        app",[1798,2527,2014],{"class":1808},[1798,2529,2530],{"class":1828},"quit",[1798,2532,1899],{"class":1945},[1798,2534,1847],{"class":1808},[1798,2536,2538],{"class":1800,"line":2537},46,[1798,2539,2540],{"class":1808},"    }\n",[1798,2542,2544,2546,2548],{"class":1800,"line":2543},47,[1798,2545,1822],{"class":1808},[1798,2547,1844],{"class":1812},[1798,2549,1847],{"class":1808},[1629,2551,2552,2555],{},[1678,2553,2554],{},"windows"," 保存仍然存在的窗口对象。窗口关闭后将它从集合中移除，避免继续保留已经失效的引用。",[1629,2557,2558],{},"两个窗口加载同一个页面，通过查询参数取得自己的名称：",[1788,2560,2564],{"className":2561,"code":2562,"filename":2060,"language":2563,"meta":1794,"style":1794},"language-html shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003C!doctype html>\n\u003Chtml lang=\"zh-CN\">\n    \u003Chead>\n        \u003Cmeta charset=\"UTF-8\" />\n        \u003Cmeta\n            http-equiv=\"Content-Security-Policy\"\n            content=\"default-src 'self'; script-src 'self'\"\n        />\n        \u003Ctitle>进程模型示例\u003C/title>\n    \u003C/head>\n    \u003Cbody>\n        \u003Ch1 id=\"window-name\">\u003C/h1>\n        \u003Cp>当前计数：\u003Cspan id=\"count\">0\u003C/span>\u003C/p>\n        \u003Cbutton id=\"add\">加一\u003C/button>\n\n        \u003Cscript src=\"./renderer.js\">\u003C/script>\n    \u003C/body>\n\u003C/html>\n","html",[1678,2565,2566,2580,2602,2612,2635,2642,2657,2671,2676,2696,2705,2714,2740,2781,2809,2813,2838,2846],{"__ignoreMap":1794},[1798,2567,2568,2571,2574,2577],{"class":1800,"line":1801},[1798,2569,2570],{"class":1808},"\u003C!",[1798,2572,2573],{"class":1945},"doctype",[1798,2575,2576],{"class":1804}," html",[1798,2578,2579],{"class":1808},">\n",[1798,2581,2582,2585,2587,2590,2592,2595,2598,2600],{"class":1800,"line":1850},[1798,2583,2584],{"class":1808},"\u003C",[1798,2586,2563],{"class":1945},[1798,2588,2589],{"class":1804}," lang",[1798,2591,1858],{"class":1808},[1798,2593,2594],{"class":1808},"\"",[1798,2596,2597],{"class":1838},"zh-CN",[1798,2599,2594],{"class":1808},[1798,2601,2579],{"class":1808},[1798,2603,2604,2607,2610],{"class":1800,"line":1876},[1798,2605,2606],{"class":1808},"    \u003C",[1798,2608,2609],{"class":1945},"head",[1798,2611,2579],{"class":1808},[1798,2613,2614,2617,2620,2623,2625,2627,2630,2632],{"class":1800,"line":1883},[1798,2615,2616],{"class":1808},"        \u003C",[1798,2618,2619],{"class":1945},"meta",[1798,2621,2622],{"class":1804}," charset",[1798,2624,1858],{"class":1808},[1798,2626,2594],{"class":1808},[1798,2628,2629],{"class":1838},"UTF-8",[1798,2631,2594],{"class":1808},[1798,2633,2634],{"class":1808}," />\n",[1798,2636,2637,2639],{"class":1800,"line":1904},[1798,2638,2616],{"class":1808},[1798,2640,2641],{"class":1945},"meta\n",[1798,2643,2644,2647,2649,2651,2654],{"class":1800,"line":1909},[1798,2645,2646],{"class":1804},"            http-equiv",[1798,2648,1858],{"class":1808},[1798,2650,2594],{"class":1808},[1798,2652,2653],{"class":1838},"Content-Security-Policy",[1798,2655,2656],{"class":1808},"\"\n",[1798,2658,2659,2662,2664,2666,2669],{"class":1800,"line":1929},[1798,2660,2661],{"class":1804},"            content",[1798,2663,1858],{"class":1808},[1798,2665,2594],{"class":1808},[1798,2667,2668],{"class":1838},"default-src 'self'; script-src 'self'",[1798,2670,2656],{"class":1808},[1798,2672,2673],{"class":1800,"line":1951},[1798,2674,2675],{"class":1808},"        />\n",[1798,2677,2678,2680,2683,2686,2689,2692,2694],{"class":1800,"line":1967},[1798,2679,2616],{"class":1808},[1798,2681,2682],{"class":1945},"title",[1798,2684,2685],{"class":1808},">",[1798,2687,2688],{"class":1812},"进程模型示例",[1798,2690,2691],{"class":1808},"\u003C/",[1798,2693,2682],{"class":1945},[1798,2695,2579],{"class":1808},[1798,2697,2698,2701,2703],{"class":1800,"line":1980},[1798,2699,2700],{"class":1808},"    \u003C/",[1798,2702,2609],{"class":1945},[1798,2704,2579],{"class":1808},[1798,2706,2707,2709,2712],{"class":1800,"line":1993},[1798,2708,2606],{"class":1808},[1798,2710,2711],{"class":1945},"body",[1798,2713,2579],{"class":1808},[1798,2715,2716,2718,2721,2724,2726,2728,2731,2733,2736,2738],{"class":1800,"line":2003},[1798,2717,2616],{"class":1808},[1798,2719,2720],{"class":1945},"h1",[1798,2722,2723],{"class":1804}," id",[1798,2725,1858],{"class":1808},[1798,2727,2594],{"class":1808},[1798,2729,2730],{"class":1838},"window-name",[1798,2732,2594],{"class":1808},[1798,2734,2735],{"class":1808},">\u003C/",[1798,2737,2720],{"class":1945},[1798,2739,2579],{"class":1808},[1798,2741,2742,2744,2746,2748,2751,2753,2755,2757,2759,2761,2764,2766,2768,2771,2773,2775,2777,2779],{"class":1800,"line":2008},[1798,2743,2616],{"class":1808},[1798,2745,1629],{"class":1945},[1798,2747,2685],{"class":1808},[1798,2749,2750],{"class":1812},"当前计数：",[1798,2752,2584],{"class":1808},[1798,2754,1798],{"class":1945},[1798,2756,2723],{"class":1804},[1798,2758,1858],{"class":1808},[1798,2760,2594],{"class":1808},[1798,2762,2763],{"class":1838},"count",[1798,2765,2594],{"class":1808},[1798,2767,2685],{"class":1808},[1798,2769,2770],{"class":1812},"0",[1798,2772,2691],{"class":1808},[1798,2774,1798],{"class":1945},[1798,2776,2735],{"class":1808},[1798,2778,1629],{"class":1945},[1798,2780,2579],{"class":1808},[1798,2782,2783,2785,2788,2790,2792,2794,2796,2798,2800,2803,2805,2807],{"class":1800,"line":2029},[1798,2784,2616],{"class":1808},[1798,2786,2787],{"class":1945},"button",[1798,2789,2723],{"class":1804},[1798,2791,1858],{"class":1808},[1798,2793,2594],{"class":1808},[1798,2795,2017],{"class":1838},[1798,2797,2594],{"class":1808},[1798,2799,2685],{"class":1808},[1798,2801,2802],{"class":1812},"加一",[1798,2804,2691],{"class":1808},[1798,2806,2787],{"class":1945},[1798,2808,2579],{"class":1808},[1798,2810,2811],{"class":1800,"line":2071},[1798,2812,1880],{"emptyLinePlaceholder":1879},[1798,2814,2815,2817,2820,2823,2825,2827,2830,2832,2834,2836],{"class":1800,"line":2086},[1798,2816,2616],{"class":1808},[1798,2818,2819],{"class":1945},"script",[1798,2821,2822],{"class":1804}," src",[1798,2824,1858],{"class":1808},[1798,2826,2594],{"class":1808},[1798,2828,2829],{"class":1838},"./renderer.js",[1798,2831,2594],{"class":1808},[1798,2833,2735],{"class":1808},[1798,2835,2819],{"class":1945},[1798,2837,2579],{"class":1808},[1798,2839,2840,2842,2844],{"class":1800,"line":2095},[1798,2841,2700],{"class":1808},[1798,2843,2711],{"class":1945},[1798,2845,2579],{"class":1808},[1798,2847,2848,2850,2852],{"class":1800,"line":2100},[1798,2849,2691],{"class":1808},[1798,2851,2563],{"class":1945},[1798,2853,2579],{"class":1808},[1629,2855,2856],{},"页面交互写在渲染进程中：",[1788,2858,2861],{"className":1790,"code":2859,"filename":2860,"language":1793,"meta":1794,"style":1794},"const params = new URLSearchParams(window.location.search);\nconst windowName = params.get('name');\nconst nameElement = document.querySelector('#window-name');\nconst countElement = document.querySelector('#count');\nconst addButton = document.querySelector('#add');\n\nlet count = 0;\n\nnameElement.textContent = windowName;\ndocument.title = windowName;\n\naddButton.addEventListener('click', () => {\n    count += 1;\n    countElement.textContent = count;\n});\n","renderer.js",[1678,2862,2863,2892,2921,2951,2979,3007,3011,3025,3029,3046,3061,3065,3092,3105,3122],{"__ignoreMap":1794},[1798,2864,2865,2867,2870,2872,2874,2877,2880,2882,2885,2887,2890],{"class":1800,"line":1801},[1798,2866,1805],{"class":1804},[1798,2868,2869],{"class":1812}," params ",[1798,2871,1858],{"class":1808},[1798,2873,1893],{"class":1808},[1798,2875,2876],{"class":1828}," URLSearchParams",[1798,2878,2879],{"class":1812},"(window",[1798,2881,2014],{"class":1808},[1798,2883,2884],{"class":1812},"location",[1798,2886,2014],{"class":1808},[1798,2888,2889],{"class":1812},"search)",[1798,2891,1847],{"class":1808},[1798,2893,2894,2896,2899,2901,2904,2906,2909,2911,2913,2915,2917,2919],{"class":1800,"line":1850},[1798,2895,1805],{"class":1804},[1798,2897,2898],{"class":1812}," windowName ",[1798,2900,1858],{"class":1808},[1798,2902,2903],{"class":1812}," params",[1798,2905,2014],{"class":1808},[1798,2907,2908],{"class":1828},"get",[1798,2910,1832],{"class":1812},[1798,2912,1835],{"class":1808},[1798,2914,1921],{"class":1838},[1798,2916,1835],{"class":1808},[1798,2918,1844],{"class":1812},[1798,2920,1847],{"class":1808},[1798,2922,2923,2925,2928,2930,2933,2935,2938,2940,2942,2945,2947,2949],{"class":1800,"line":1876},[1798,2924,1805],{"class":1804},[1798,2926,2927],{"class":1812}," nameElement ",[1798,2929,1858],{"class":1808},[1798,2931,2932],{"class":1812}," document",[1798,2934,2014],{"class":1808},[1798,2936,2937],{"class":1828},"querySelector",[1798,2939,1832],{"class":1812},[1798,2941,1835],{"class":1808},[1798,2943,2944],{"class":1838},"#window-name",[1798,2946,1835],{"class":1808},[1798,2948,1844],{"class":1812},[1798,2950,1847],{"class":1808},[1798,2952,2953,2955,2958,2960,2962,2964,2966,2968,2970,2973,2975,2977],{"class":1800,"line":1883},[1798,2954,1805],{"class":1804},[1798,2956,2957],{"class":1812}," countElement ",[1798,2959,1858],{"class":1808},[1798,2961,2932],{"class":1812},[1798,2963,2014],{"class":1808},[1798,2965,2937],{"class":1828},[1798,2967,1832],{"class":1812},[1798,2969,1835],{"class":1808},[1798,2971,2972],{"class":1838},"#count",[1798,2974,1835],{"class":1808},[1798,2976,1844],{"class":1812},[1798,2978,1847],{"class":1808},[1798,2980,2981,2983,2986,2988,2990,2992,2994,2996,2998,3001,3003,3005],{"class":1800,"line":1904},[1798,2982,1805],{"class":1804},[1798,2984,2985],{"class":1812}," addButton ",[1798,2987,1858],{"class":1808},[1798,2989,2932],{"class":1812},[1798,2991,2014],{"class":1808},[1798,2993,2937],{"class":1828},[1798,2995,1832],{"class":1812},[1798,2997,1835],{"class":1808},[1798,2999,3000],{"class":1838},"#add",[1798,3002,1835],{"class":1808},[1798,3004,1844],{"class":1812},[1798,3006,1847],{"class":1808},[1798,3008,3009],{"class":1800,"line":1909},[1798,3010,1880],{"emptyLinePlaceholder":1879},[1798,3012,3013,3016,3019,3021,3023],{"class":1800,"line":1929},[1798,3014,3015],{"class":1804},"let",[1798,3017,3018],{"class":1812}," count ",[1798,3020,1858],{"class":1808},[1798,3022,2419],{"class":1960},[1798,3024,1847],{"class":1808},[1798,3026,3027],{"class":1800,"line":1951},[1798,3028,1880],{"emptyLinePlaceholder":1879},[1798,3030,3031,3034,3036,3039,3041,3044],{"class":1800,"line":1967},[1798,3032,3033],{"class":1812},"nameElement",[1798,3035,2014],{"class":1808},[1798,3037,3038],{"class":1812},"textContent ",[1798,3040,1858],{"class":1808},[1798,3042,3043],{"class":1812}," windowName",[1798,3045,1847],{"class":1808},[1798,3047,3048,3050,3052,3055,3057,3059],{"class":1800,"line":1980},[1798,3049,7],{"class":1812},[1798,3051,2014],{"class":1808},[1798,3053,3054],{"class":1812},"title ",[1798,3056,1858],{"class":1808},[1798,3058,3043],{"class":1812},[1798,3060,1847],{"class":1808},[1798,3062,3063],{"class":1800,"line":1993},[1798,3064,1880],{"emptyLinePlaceholder":1879},[1798,3066,3067,3070,3072,3075,3077,3079,3082,3084,3086,3088,3090],{"class":1800,"line":2003},[1798,3068,3069],{"class":1812},"addButton",[1798,3071,2014],{"class":1808},[1798,3073,3074],{"class":1828},"addEventListener",[1798,3076,1832],{"class":1812},[1798,3078,1835],{"class":1808},[1798,3080,3081],{"class":1838},"click",[1798,3083,1835],{"class":1808},[1798,3085,1816],{"class":1808},[1798,3087,2121],{"class":1808},[1798,3089,2124],{"class":1804},[1798,3091,1926],{"class":1808},[1798,3093,3094,3097,3100,3103],{"class":1800,"line":2008},[1798,3095,3096],{"class":1812},"    count",[1798,3098,3099],{"class":1808}," +=",[1798,3101,3102],{"class":1960}," 1",[1798,3104,1847],{"class":1808},[1798,3106,3107,3110,3112,3115,3117,3120],{"class":1800,"line":2029},[1798,3108,3109],{"class":1812},"    countElement",[1798,3111,2014],{"class":1808},[1798,3113,3114],{"class":1812},"textContent",[1798,3116,1825],{"class":1808},[1798,3118,3119],{"class":1812}," count",[1798,3121,1847],{"class":1808},[1798,3123,3124,3126,3128],{"class":1800,"line":2071},[1798,3125,1822],{"class":1808},[1798,3127,1844],{"class":1812},[1798,3129,1847],{"class":1808},[1629,3131,3132],{},"运行项目：",[1788,3134,3138],{"className":3135,"code":3136,"language":3137,"meta":1794,"style":1794},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm start\n","bash",[1678,3139,3140],{"__ignoreMap":1794},[1798,3141,3142,3146],{"class":1800,"line":1801},[1798,3143,3145],{"class":3144},"sYGMc","npm",[1798,3147,3148],{"class":1838}," start\n",[1629,3150,3151,3152,3154],{},"页面会打开“窗口 A”和“窗口 B”。在窗口 A 中连续点击“加一”，窗口 B 的数字不会变化，因为两个窗口拥有独立的 DOM 和 ",[1678,3153,2763],{}," 变量。",[1629,3156,3157],{},"这里不需要 IPC：两个窗口只修改自己的页面状态，没有交换数据。需要在窗口之间共享信息时，再由主进程和 IPC 负责传递。",[1668,3159],{},[1629,3161,3162,3163,3165,3166,3169],{},"窗口创建、重新激活和退出属于应用生命周期，下一篇会集中讲解。本篇只保留一个重要前提：",[1678,3164,1694],{}," 必须在 ",[1678,3167,3168],{},"app.whenReady()"," 完成后创建。",[1668,3171],{},[1624,3173,3175],{"id":3174},"代码应该放在哪里","💡 代码应该放在哪里",[1629,3177,3178],{},"判断代码位置时，先看它操作的对象：",[1652,3180,3181,3187,3192],{},[1655,3182,3183,3184,3186],{},"创建窗口、退出应用、打开系统对话框，放在",[1633,3185,1635],{},"。",[1655,3188,3189,3190,3186],{},"修改文字、监听按钮、更新页面样式，放在",[1633,3191,1639],{},[1655,3193,3194,3195,3197],{},"页面需要使用桌面能力时，由",[1633,3196,1643],{},"暴露一个用途明确的接口。",[1629,3199,3200,3201,3203],{},"例如，下面这段代码只能放在主进程，因为 ",[1678,3202,1694],{}," 负责创建桌面窗口：",[1788,3205,3207],{"className":1790,"code":3206,"language":1793,"meta":1794,"style":1794},"const win = new BrowserWindow({\n    width: 600,\n    height: 400,\n});\n",[1678,3208,3209,3226,3238,3250],{"__ignoreMap":1794},[1798,3210,3211,3213,3216,3218,3220,3222,3224],{"class":1800,"line":1801},[1798,3212,1805],{"class":1804},[1798,3214,3215],{"class":1812}," win ",[1798,3217,1858],{"class":1808},[1798,3219,1893],{"class":1808},[1798,3221,1942],{"class":1828},[1798,3223,1832],{"class":1812},[1798,3225,1948],{"class":1808},[1798,3227,3228,3231,3233,3236],{"class":1800,"line":1850},[1798,3229,3230],{"class":1945},"    width",[1798,3232,1957],{"class":1808},[1798,3234,3235],{"class":1960}," 600",[1798,3237,1964],{"class":1808},[1798,3239,3240,3243,3245,3248],{"class":1800,"line":1876},[1798,3241,3242],{"class":1945},"    height",[1798,3244,1957],{"class":1808},[1798,3246,3247],{"class":1960}," 400",[1798,3249,1964],{"class":1808},[1798,3251,3252,3254,3256],{"class":1800,"line":1883},[1798,3253,1822],{"class":1808},[1798,3255,1844],{"class":1812},[1798,3257,1847],{"class":1808},[1629,3259,3260],{},"下面这段代码应该放在渲染进程，因为它操作页面 DOM：",[1788,3262,3264],{"className":1790,"code":3263,"language":1793,"meta":1794,"style":1794},"document.querySelector('#title').textContent = '你好，Electron';\n",[1678,3265,3266],{"__ignoreMap":1794},[1798,3267,3268,3270,3272,3274,3276,3278,3281,3283,3285,3287,3289,3291,3293,3296,3298],{"class":1800,"line":1801},[1798,3269,7],{"class":1812},[1798,3271,2014],{"class":1808},[1798,3273,2937],{"class":1828},[1798,3275,1832],{"class":1812},[1798,3277,1835],{"class":1808},[1798,3279,3280],{"class":1838},"#title",[1798,3282,1835],{"class":1808},[1798,3284,1844],{"class":1812},[1798,3286,2014],{"class":1808},[1798,3288,3038],{"class":1812},[1798,3290,1858],{"class":1808},[1798,3292,2057],{"class":1808},[1798,3294,3295],{"class":1838},"你好，Electron",[1798,3297,1835],{"class":1808},[1798,3299,1847],{"class":1808},[1629,3301,3302],{},"渲染进程不能直接调用主进程中的函数。需要跨进程协作时，要通过预加载脚本和 IPC 建立明确的通信通道。",[1668,3304],{},[1624,3306,3308],{"id":3307},"小节总结","🧾 小节总结",[1652,3310,3311,3314,3319,3322,3328],{},[1655,3312,3313],{},"Electron 应用只有一个主进程，负责管理应用、窗口和系统能力。",[1655,3315,3316,3318],{},[1678,3317,1694],{}," 加载的页面运行在独立的页面环境中。",[1655,3320,3321],{},"不同窗口不会自动共享 DOM 和 JavaScript 变量。",[1655,3323,3324,3325,3327],{},"窗口创建需要等待 ",[1678,3326,3168],{},"，详细生命周期会在下一篇讲解。",[1655,3329,3330],{},"预加载脚本负责连接渲染进程与桌面能力，具体通信方式将在下一篇讲解。",[1668,3332],{},[1624,3334,3336],{"id":3335},"知识问答","❓ 知识问答",[1629,3338,3339],{},[1633,3340,3341],{},"Q1：一个 Electron 应用可以创建多个窗口吗？",[1629,3343,3344,3345,3347],{},"A：可以。主进程可以创建多个 ",[1678,3346,1694],{},"，并分别加载不同页面或同一个页面。",[1629,3349,3350],{},[1633,3351,3352],{},"Q2：两个窗口中的 JavaScript 变量会自动共享吗？",[1629,3354,3355],{},"A：不会。每个窗口都有独立的页面环境，需要共享数据时应通过主进程和 IPC 传递。",[1629,3357,3358],{},[1633,3359,3360],{},"Q3：每个窗口一定对应一个独立的操作系统进程吗？",[1629,3362,3363],{},"A：不一定。Chromium 会负责底层进程安排。开发时应该依赖窗口之间的页面隔离，不要依赖具体的操作系统进程数量。",[1629,3365,3366],{},[1633,3367,3368],{},"Q4：为什么关闭一个窗口后应用没有退出？",[1629,3370,3371,3372,3374],{},"A：因为还有其他窗口存在。",[1678,3373,2479],{}," 只有在所有窗口都关闭后才会触发。",[1629,3376,3377],{},[1633,3378,3379],{},"Q5：预加载脚本属于渲染进程吗？",[1629,3381,3382],{},"A：它与指定窗口一起运行，但处在和页面隔离的上下文中，拥有比普通页面更高的权限。它应该只暴露页面确实需要的能力。",[1668,3384],{},[1624,3386,3388],{"id":3387},"小练习","🧪 小练习",[1629,3390,3391,3394],{},[1633,3392,3393],{},"练习一","：补全代码，再创建一个名为“窗口 C”的窗口：",[1788,3396,3398],{"className":1790,"code":3397,"language":1793,"meta":1794,"style":1794},"function createApplicationWindows() {\n    createWindow('窗口 A');\n    createWindow('窗口 B');\n\n    // 请在这里编写代码\n}\n",[1678,3399,3400,3410,3427,3443,3447,3453],{"__ignoreMap":1794},[1798,3401,3402,3404,3406,3408],{"class":1800,"line":1801},[1798,3403,1912],{"class":1804},[1798,3405,2189],{"class":1828},[1798,3407,1899],{"class":1808},[1798,3409,1926],{"class":1808},[1798,3411,3412,3415,3417,3419,3421,3423,3425],{"class":1800,"line":1850},[1798,3413,3414],{"class":1828},"    createWindow",[1798,3416,1832],{"class":1945},[1798,3418,1835],{"class":1808},[1798,3420,2212],{"class":1838},[1798,3422,1835],{"class":1808},[1798,3424,1844],{"class":1945},[1798,3426,1847],{"class":1808},[1798,3428,3429,3431,3433,3435,3437,3439,3441],{"class":1800,"line":1876},[1798,3430,3414],{"class":1828},[1798,3432,1832],{"class":1945},[1798,3434,1835],{"class":1808},[1798,3436,2237],{"class":1838},[1798,3438,1835],{"class":1808},[1798,3440,1844],{"class":1945},[1798,3442,1847],{"class":1808},[1798,3444,3445],{"class":1800,"line":1883},[1798,3446,1880],{"emptyLinePlaceholder":1879},[1798,3448,3449],{"class":1800,"line":1904},[1798,3450,3452],{"class":3451},"syuKq","    // 请在这里编写代码\n",[1798,3454,3455],{"class":1800,"line":1909},[1798,3456,2176],{"class":1808},[1629,3458,3459,3462],{},[1633,3460,3461],{},"练习二","：补全激活事件，在没有窗口时重新创建窗口：",[1788,3464,3466],{"className":1790,"code":3465,"language":1793,"meta":1794,"style":1794},"app.on('activate', () => {\n    // 请在这里编写代码\n});\n",[1678,3467,3468,3492,3496],{"__ignoreMap":1794},[1798,3469,3470,3472,3474,3476,3478,3480,3482,3484,3486,3488,3490],{"class":1800,"line":1801},[1798,3471,1738],{"class":1812},[1798,3473,2014],{"class":1808},[1798,3475,2107],{"class":1828},[1798,3477,1832],{"class":1812},[1798,3479,1835],{"class":1808},[1798,3481,2380],{"class":1838},[1798,3483,1835],{"class":1808},[1798,3485,1816],{"class":1808},[1798,3487,2121],{"class":1808},[1798,3489,2124],{"class":1804},[1798,3491,1926],{"class":1808},[1798,3493,3494],{"class":1800,"line":1850},[1798,3495,3452],{"class":3451},[1798,3497,3498,3500,3502],{"class":1800,"line":1876},[1798,3499,1822],{"class":1808},[1798,3501,1844],{"class":1812},[1798,3503,1847],{"class":1808},[1629,3505,3506],{},"完成练习后，分别修改三个窗口中的计数，观察它们的数字是否会互相影响。",[1668,3508],{},[1629,3510,3511],{},"🎉 恭喜你已经理解 Electron 的进程分工啦！下一篇我们会把 Vue 页面接入 Electron，之后再使用 preload 和 IPC 请求主进程能力。",[3513,3514,3515],"style",{},"html pre.shiki code .s50WR, html code.shiki .s50WR{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s86vT, html code.shiki .s86vT{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sndM8, html code.shiki .sndM8{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .swgpB, html code.shiki .swgpB{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sIEYB, html code.shiki .sIEYB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sK9QF, html code.shiki .sK9QF{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sd2Uz, html code.shiki .sd2Uz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .smPcV, html code.shiki .smPcV{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s8pZq, html code.shiki .s8pZq{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sYGMc, html code.shiki .sYGMc{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .syuKq, html code.shiki .syuKq{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":1794,"searchDepth":1850,"depth":1850,"links":3517},[3518,3519,3520,3521,3522,3523,3524],{"id":1626,"depth":1850,"text":1627},{"id":1672,"depth":1850,"text":1673},{"id":1779,"depth":1850,"text":1780},{"id":3174,"depth":1850,"text":3175},{"id":3307,"depth":1850,"text":3308},{"id":3335,"depth":1850,"text":3336},{"id":3387,"depth":1850,"text":3388},"理解主进程、渲染进程和预加载脚本的职责，为接入 Vue 和安全 IPC 建立基础。","md",null,{},{"title":1533},{"title":1619,"description":3525},"CF5u6sta67",[3533,3535],{"title":1531,"path":1527,"stem":1528,"description":3534,"children":-1},"了解 Electron 的运行方式，搭建开发环境并运行第一个桌面应用，建立完整的桌面开发学习路线。",{"title":1537,"path":1538,"stem":1539,"description":3536,"children":-1},"把 Vue 页面接入 Electron，理解开发服务器、生产构建和资源路径的基本差异。",1789632408948]