大家好
我正在尝试从我的ElectronJS/Nuxt 3应用程序中构建一个版本。我只看到一个白色屏幕。我已经尝试了SO周围提到的hashmode选项,但它仍然不起作用。我做错了什么,它仍然不起作用?我在下面粘贴我的代码,看看是否有人可以帮助引导我在正确的方向。我已经分析了文件,问题是在vue-router,特别是它如何将资源文件的路径设置为file:///
而不是绝对路径。
下面是我的nuxt.config.ts:
export default defineNuxtConfig({
ssr: false,
router: {
options: {
hashMode: true
}
},
app: {
baseURL: './',
},
modules: ['nuxt-primevue', 'nuxt-electron'],
css: ['~/assets/theme.css', '~/assets/styles.css'],
electron: {
build: [
{
// Main-Process entry file of the Electron App.
entry: 'electron/main.ts',
},
{
entry: 'electron/preload.ts',
onstart(options) {
// Notify the Renderer-Process to reload the page when the Preload-Scripts build is complete,
// instead of restarting the entire Electron App.
options.reload()
},
},
],
renderer: {},
}
})
字符串
我很感激你的帮助。谢谢。
1条答案
按热度按时间sq1bmfud1#
如果您使用的是Nuxt 3.8,请尝试降级到Nuxt 3.7。