If the user has navigated into a project in the app, I want project-specific menu items like 'Start project' to be enabled. Lastly, I wanted to update the application menu based on where the user is. But when the menu is defined in the main process, I can't call a method like `createProject' in the example above because that would be an action in the Vuex store. Secondly, Serve's renderer process is running a Vue application. This JSON object is hard to read and understand easily. First of all, it becomes quite a messy JSON tree when building out the entire menu structure. I found a couple of limitations with the existing API. The example above creates a 'File' submenu with two menu items. It involves building a template of JSON objects that represent submenus and menu items.Įnter fullscreen mode Exit fullscreen mode The existing API for creating application menus work in the main process. IPC is essentially an event system that works across the processes. The processes can communicate with each other through what's called 'Inter-Process Communication' (IPC). The renderer process is a browser environment and is responsible for handling the UI of the application. The main process is a node environment and has access to the filesystem. If you are not familiar with Electron apps, I'll quickly run through the main architecture concepts.Īn Electron app has two processes: The main process and the renderer process. But I ran into some limitations with the existing Electron API, so I set out on a mission to figure out how to define the menu in a Vue component. In the latest release, I wanted to revamp the application menu. It's an Electron app that makes it easy to set up local development environments for Laravel. Create application menus with Vue templates in Electronįor the last few months, I've been working on an app called Serve.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |