Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How this works on electron-vue ? #3

Closed
Tonysmark opened this issue Mar 25, 2019 · 6 comments
Closed

Question: How this works on electron-vue ? #3

Tonysmark opened this issue Mar 25, 2019 · 6 comments

Comments

@Tonysmark
Copy link

function createWindow() {
  /**
   * Initial window options
   */
  mainWindow = new BrowserWindow({
    width: 1400,
    height: 900,
    minWidth: 768,
    webPreferences: {
      nodeIntegration: true
    },
    frame: false,
    backgroundColor: "#00000000"
  });

  mainWindow.loadURL(winURL);

  mainWindow.on("closed", () => {
    mainWindow = null;
  });
  SetWindowCompositionAttribute(
    mainWindow.getNativeWindowHandle(),
    ACCENT_STATE.ACCENT_ENABLE_ACRYLICBLURBEHIND,
    0x10000000
  );
}

this works on electron but electron-vue is another story.

@sylveon
Copy link
Owner

sylveon commented Mar 25, 2019

It's possible that electron-vue's default page is white. You'd need to apply CSS to make it transparent.

@Tonysmark
Copy link
Author

No.....I've tried many times but none of them works exactly as this package. So......I'm getting little confuse right now.

@I-Want-ToBelieve
Copy link

This package works fine in electron-vue.
Snipaste_2019-04-05_19-10-10
Snipaste_2019-04-05_19-10-26

However, I have encountered a compilation problem.
Do you have a similar problem?
Maybe this can help you: onmyway133/blog#69

And the version of python can't be 3.x, which will also cause the compilation to fail.

This is the command I made it compile and execute successfully.:

rm -rf node_modules
yarn upgrade electron@^4.1.1
yarn add electron-rebuild -D

@sylveon
Copy link
Owner

sylveon commented Apr 6, 2019

The fact that they had to break the ABI is pretty awful, I'll add a note about electron-rebuild later today.

@I-Want-ToBelieve
Copy link

This will reduce the difficulty for people to get started, good work.

@sylveon
Copy link
Owner

sylveon commented Apr 7, 2019

Ok so after some testing: I have Python 3.7 in my global PATH and Python 2.7 installed but not in my PATH and it did work. That is all documented on node-gyp's README or in the Microsoft node.js guidelines which I will also link in the README for convenience's sake.

Indeed without running electron-rebuild I ran into an ABI version mismatch, but a simple npx electron-rebuild also fixed that.

image

@sylveon sylveon closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants