电子构建的应用程序,设置最小显示大小

发布于 2025-01-30 10:51:10 字数 1028 浏览 0 评论 0原文

安装后用户运行时,我需要在桌面应用程序上设置最小宽度和高度。 ,您会看到电子浏览器windows更改了

我已经添加了minwidth&对Broserwindow的明显,但行不通。

 const win = new BrowserWindow({
    width: 1600,
    height: 700,
    minWidth: 1024,
    minHeight: 576,
    frame: false,
    webPreferences: {
      // Use pluginOptions.nodeIntegration, leave this alone
      // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
      // devTools: false,
      nodeIntegration: false,
      preload: path.join(__dirname, "preload.js"),
    },
  });

还增加了最小宽度&车身的最低点:

html body {
  min-width: 1024px;
  min-height: 576px;
  padding: 0;
  margin: 0;
  font-family: "Noto Sans", sans-serif;
  box-sizing: border-box;
  background-color: rgb(31, 31, 31);
}

这是在上安装的应用程序

吗?

I need to set the minimum width and height on my desktop app when the user runs it after installation.
As you see the electron browserWindows changed

I already add minWidth & minHeight to BroserWindow, but doesn't work.

 const win = new BrowserWindow({
    width: 1600,
    height: 700,
    minWidth: 1024,
    minHeight: 576,
    frame: false,
    webPreferences: {
      // Use pluginOptions.nodeIntegration, leave this alone
      // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
      // devTools: false,
      nodeIntegration: false,
      preload: path.join(__dirname, "preload.js"),
    },
  });

also added min-width & min-height in body:

html body {
  min-width: 1024px;
  min-height: 576px;
  padding: 0;
  margin: 0;
  font-family: "Noto Sans", sans-serif;
  box-sizing: border-box;
  background-color: rgb(31, 31, 31);
}

This is installed app on

any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文