5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 13:02:04 +08:00
wails/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/frameless.mdx
2021-09-27 19:35:30 +10:00

32 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebar_position: 10
---
# 无边框应用
Wails 支持无边框应用程序。这可以通过使用[应用程序参数选项](/docs/reference/options#应用程序参数选项)中的[无边框](/docs/reference/options#无边框)字段来实现。
Wails 为拖动窗口提供了一个简单的解决方案任何具有“data-wails-drag”属性的 HTML 元素都将充当“拖动手柄”。
此属性适用于所有嵌套元素。如果您需要指定不应该拖动的嵌套元素请在该元素上使用属性“data-wails-no-drag”。
默认的 vanilla 模板使用它,即使它不是无边框的。整个 body 元素被标记为可拖动。`<div id="input" data-wails-no-drag>`元素被标记为不可拖动。
```html
<html>
<head>
<link rel="stylesheet" href="/main.css" />
</head>
<body data-wails-drag>
<div id="logo"></div>
<div id="input" data-wails-no-drag>
<input id="name" type="text" />
<button onclick="greet()">Greet</button>
</div>
<div id="result"></div>
<script src="/main.js"></script>
</body>
</html>
```