1

(sorry for my bad english)

Hello. How can I make a fixed menu and changing html like vscode on the electron.js? For example, get a menu. We have 3 html files in one:

page1.html
page2.html
page3.html

When I click on page1 in the menu, it will go to page1 and the menu will remain fixed. At the same time, when I click on page2, it will go to page2 and again, the menu will remain fixed.I tried redirected to the html pages as follows:

ipcMain.on("goPage1",(err,data) => {
    mainWindow.loadURL(`file://${__dirname}/page1.html`)
})

right its work,but I do not know this correct. In fact, I can do this to keep the menu fixed on every page, maybe, get a base.html. here get a menu.Also get a div element with the id # myDiv. Let's do page1.html. I don't know if this is the right way. To summarize the topic: How can we make a fixed menu like vscode and changing pages? What I said above is the right way? What is the best way to do them? Thank you for reading so far, my friend. I will be very happy if you answer my questions. I am looking forward to your reply.thanks now...

Abdullah-V
  • 21
  • 1
  • 8
  • really nobody not know answer?or my english is very bad?if my english is bad,please tell me i rewrite this question. – Abdullah-V Sep 23 '20 at 08:16
  • It's not clear (to me at least) what you are asking. Which "menu" are you referring to, the window menu? Do you want it to change based on the current page? – spring Sep 23 '20 at 16:53
  • think vscode.menu on left.and menu buttons route we pages.but menu is fixed.i found this:https://stackoverflow.com/questions/55462919/how-should-multiple-html-files-be-rendered-in-a-single-window-within-electron.and this work for me.but this is right way?example:vscode how doing this? I hope I could explain – Abdullah-V Sep 23 '20 at 17:06
  • Ah, I see what you mean now – a fixed sidebar which functions as a "menu". I haven't needed to do that before. I wonder if VSCode uses the `tab` functionality for that? – spring Sep 23 '20 at 17:35

0 Answers0