前端配置
Tauri 对前端框架无偏好,并且开箱即支持大多数前端框架。然而,有时某些框架需要一些额外的配置才能与 Tauri 集成。以下是带有推荐配置的框架列表。
🌐 Tauri is frontend agnostic and supports most frontend frameworks out of the box. However, sometimes a framework need a bit of extra configuration to integrate with Tauri. Below is a list of frameworks with recommended configurations.
如果某个框架未被列出,则它可能可以在 Tauri 中使用而无需额外配置,也可能尚未被记录。欢迎任何为添加可能需要额外配置的框架的贡献,以帮助 Tauri 社区的其他人。
🌐 If a framework is not listed then it may work with Tauri with no additional configuration needed or it could have not been documented yet. Any contributions to add a framework that may require additional configuration are welcome to help others in the Tauri community.
🌐 Configuration Checklist
从概念上讲,Tauri 的作用类似于静态网页托管。你需要向 Tauri 提供一个包含 HTML、CSS、Javascript 以及可能的 WASM 的文件夹,这些内容可以被提供给 Tauri 提供的 webview。
🌐 Conceptually Tauri acts as a static web host. You need to provide Tauri with a folder containing some mix of HTML, CSS, Javascript and possibly WASM that can be served to the webview Tauri provides.
以下是将前端与 Tauri 集成所需的常见场景清单:
🌐 Below is a checklist of common scenarios needed to integrate a frontend with Tauri:
- 使用静态网站生成(SSG)、单页应用(SPA)或经典多页应用(MPA)。Tauri 本身不支持基于服务器的替代方案(例如 SSR)。
- 对于移动开发,需要某种可以在内部 IP 上托管前端的开发服务器。
- 在你的应用和 API 之间使用适当的客户端-服务器关系(不使用带有 SSR 的混合解决方案)。
对于大多数项目,我们推荐使用 Vite 来构建 SPA 框架,如 React、Vue、Svelte 和 Solid,同时也适用于纯 JavaScript 或 TypeScript 项目。这里列出的其他大多数指南展示了如何使用 Meta-Frameworks,因为它们通常是为 SSR 设计的,因此需要特殊配置。
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站