Adding Features添加功能
This is part 4 of the Electron tutorial.这是Electron教程的第4部分。
Adding application complexity增加应用程序复杂性
If you have been following along, you should have a functional Electron application with a static user interface. 如果您一直在跟踪,您应该有一个具有静态用户界面的功能性Electron应用程序。From this starting point, you can generally progress in developing your app in two broad directions:从这一点出发,您通常可以在两个大方向上开发应用程序:
Adding complexity to your renderer process' web app code为渲染器进程的web应用程序代码增加复杂性Deeper integrations with the operating system and Node.js与操作系统和Node.js的深度集成
It is important to understand the distinction between these two broad concepts. 理解这两个广义概念之间的区别很重要。For the first point, Electron-specific resources are not necessary. 对于第一点,Electron特定资源是不必要的。Building a pretty to-do list in Electron is just pointing your Electron BrowserWindow to a pretty to-do list web app. 在Electron中构建一个漂亮的待办事项列表只是将您的Electron浏览器窗口指向一个漂亮待办事项清单web应用程序。Ultimately, you are building your renderer's UI using the same tools (HTML, CSS, JavaScript) that you would on the web. 最终,您将使用与web上相同的工具(HTML、CSS、JavaScript)构建渲染器的UI。Therefore, Electron's docs will not go in-depth on how to use standard web tools.因此,Electron的文档不会深入讨论如何使用标准web工具。
On the other hand, Electron also provides a rich set of tools that allow you to integrate with the desktop environment, from creating tray icons to adding global shortcuts to displaying native menus. 另一方面,Electron还提供了一套丰富的工具,允许您与桌面环境集成,从创建托盘图标到添加全局快捷键到显示本机菜单。It also gives you all the power of a Node.js environment in the main process. 它还提供了主进程中Node.js环境的所有功能。This set of capabilities separates Electron applications from running a website in a browser tab, and are the focus of Electron's documentation.这组功能将Electron应用程序与在浏览器选项卡中运行网站分开,是Electron文档的重点。
How-to examples如何举例
Electron's documentation has many tutorials to help you with more advanced topics and deeper operating system integrations. Electron的文档中有许多教程,帮助您了解更高级的主题和更深入的操作系统集成。To get started, check out the How-To Examples doc.要开始,请查看如何示例文档。
If you can't find what you are looking for, please let us know on GitHub or in our Discord server!如果您找不到您想要的,请在GitHub或Discord服务器上通知我们!
What's next?下一步是什么?
For the rest of the tutorial, we will be shifting away from application code and giving you a look at how you can get your app from your developer machine into end users' hands.在本教程的其余部分,我们将从应用程序代码转移到如何将应用程序从开发人员机器转移到最终用户手中。