misitebao / wails-template-vue

Wails template based on Vue ecology
MIT License
204 stars 28 forks source link

[Bug]Mac 下程序没有渲染出模板 #33

Closed hiifong closed 2 years ago

hiifong commented 2 years ago

1. Your usage scenarios? | 您使用的场景?

Mac 下测试

2. What did you do? | 您做了什么操作?

wails init -n app-1 -t https://github.com/misitebao/wails-template-vue wails build -clean

3. What are your problems? | 您遇到了什么问题?

image

4. What is your expected outcome? | 您期望的结果是怎样的?

image

misitebao commented 2 years ago

Sorry, I haven't tested the latest wails version, I'll fix it soon and “@you" when I'm done.

And, please provide command line and web console details.

jinl80 commented 2 years ago

frontend\packages\javascript\src\i18n\index.js 里的createI18n 参数加上 legacy:false

const i18n = createI18n({ legacy:false,

hiifong commented 2 years ago

Sorry, I haven't tested the latest wails version, I'll fix it soon and “@you" when I'm done.

And, please provide command line and web console details.

Thank you!!!this is my web console log image this is my terminal log

➜  app-1 wails dev
Wails CLI v2.0.0-beta.43

Executing: go mod tidy -compat=1.17
Executing: wails generate module
Building frontend for development...
  - Installing frontend dependencies: Done.
  - Compiling frontend: Done.
Running frontend DevWatcher command: 'npm run dev -w js'
Building application for development...
  - Compiling application:
> js@0.1.0 dev
> vite

  vite v2.9.15 dev server running at:

Vite Server URL: http://localhost:3000/
  > Local: http://localhost:3000/
  > Network: use --host to expose

  ready in 394ms.

Done.
  - Packaging application: Done.

Watching (sub)/directory: /Users/hiifong/Desktop/github.com/wails/app-1
Using DevServer URL: http://localhost:34115
Using Frontend DevServer URL: http://localhost:3000
Using reload debounce setting of 1000 milliseconds
---- WARNING ----
The `RGBA` option has been deprecated. Please use `BackgroundColour`.
INF | Serving assets from frontend DevServer URL: http://localhost:3000
Added new directory to watcher: /Users/hiifong/Desktop/github.com/wails/app-1/frontend/wailsjs/go
DEB | [DevWebServer] Serving DevServer at http://localhost:34115
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/main.js'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/@vite/client'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/node_modules/.vite/deps/vue.js?v=f5ef7a04'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/node_modules/.vite/deps/chunk-BHLBO2TT.js?v=f5ef7a04'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/router/index.js'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/components/public/index.js'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/i18n/index.js'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/App.vue'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/@fs/Users/hiifong/Desktop/github.com/wails/app-1/frontend/node_modules/vite/dist/client/env.mjs'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/node_modules/.vite/deps/vue-i18n.js?v=f5ef7a04'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/i18n/locales/zh-Hans.json?import'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/i18n/locales/en.json?import'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/i18n/locales/fr.json?import'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/node_modules/.vite/deps/vue-router.js?v=f5ef7a04'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/views/Home.vue'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/components/public/OpenLink.vue'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/@id/plugin-vue:export-helper'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/App.vue?vue&type=style&index=0&lang.scss'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/node_modules/.vite/deps/chunk-2YFCGF5S.js?v=f5ef7a04'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/components/HelloWorld.vue'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/views/Home.vue?vue&type=style&index=0&lang.scss'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/components/public/OpenLink.vue?vue&type=style&index=0&lang.scss'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css'
DEB | [ExternalAssetHandler] Loading 'http://localhost:3000/src/assets/fonts/JetBrainsMono-Medium.woff2'

To develop in the browser and call your bound Go methods from Javascript, navigate to: http://localhost:34115
hiifong commented 2 years ago

frontend\packages\javascript\src\i18n\index.js 里的createI18n 参数加上 legacy:false

const i18n = createI18n({ legacy:false,

Adding this parameter successfully solved the current problem, but I don't quite understand what is causing this, can you explain

misitebao commented 2 years ago

The specific reason can be found in the changelog of vue-i18n, which is also explained in the document. https://vue-i18n.intlify.dev/guide/migration/vue3.html#migration-to-composition-api-from-legacy-api

The reason why it used to display normally and now displays an error is because I don't have a locked version.

misitebao commented 2 years ago

@hiifong It has been fixed, please test it.

bestK commented 1 year ago

https://github.com/wailsapp/wails/issues/2947 我在windwos下 同事的电脑白屏