0.0.5 • Published 7 months ago

@whwan/electron-multiwindow v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

electron-multiwindow

electron multi-window management and toolkit

demo

init

const multiwindow = Multiwindow.initialize({
  loadURL: process.env["ELECTRON_RENDERER_URL"],
  loadFile: join(__dirname, "../renderer/index.html"),
  baseOptions: {
    width: 920,
    height: 600,
    show: false,
    frame: false,
    autoHideMenuBar: true,
    ...(process.platform === "linux" ? { icon } : {}),
    webPreferences: {
      preload: join(__dirname, "../preload/index.js"),
      sandbox: false,
    },
  },
});

Fetch manager

const multiwindow = Multiwindow.getInstance();

Create window

multiwindow.newWindow({
  width: 320,
  height: 450,
  url: "/login",
  resizable: false,
  moduleName: "login",
});

Get window

multiwindow.getWin("app"); //Obtain the value by window name
// or
multiwindow.getWin(1); // Obtain the value from the window id

Delete window

multiwindow.removeWin("app");
// or
multiwindow.removeWin(1);
0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

9 months ago