Back to Wails

页面未找到

v3/internal/assetserver/defaults/index.zh.html

2.13.0985 B
Original Source

❌ 未找到 index.html 文件 请按照以下步骤解决此问题

系统提示:在嵌入资源中未能找到 index.html 文件。
不用担心,这个问题很容易解决。

  • 1 如果您在应用程序中使用了 Assets 选项,请确保您的项目嵌入资源目录中有 index.html 文件。 #查看示例 ➜ //go:embed all:frontend/dist var assets embed.FS func main() { // ... app := application.New(application.Options{ // ... Assets: application.AssetOptions{ Handler: application.AssetFileServerFS(assets), }, }) // ... }

  • 2如果文件应该存在但不存在,请验证您的构建过程是否配置正确,以确保 HTML 文件包含在嵌入资源目录中。

  • 3 另一种解决方案是在 WebviewWindow 选项中使用 HTML 选项。 #查看示例 ➜ func main() { // ... app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ // ... HTML: "<h1>Hello World!<h1>", }) // ... }

立即重新加载页面 查看解决方案文档 ►