简体   繁体   English

在 electron 中,相对路径在 html 文件中不起作用?

[英]In electron relative paths not working in html file?

I am not able to set path of CSS and other file in my app's login screen.我无法在我的应用程序登录屏幕中设置 CSS 和其他文件的路径。

my project folder structure.我的项目文件夹结构。

Error i am getting我得到的错误

project's main file项目的主文件

I have added bootstrap and jquery using我添加了引导程序和 jquery 使用

npm install <packagename> --save

I have experience in web development using PHP but I am very new in electron development.我有使用 PHP 进行 web 开发的经验,但我对 electron 开发非常陌生。

I have fixed the issue by using path like../../../node_modules/bootstrap/dist/css/bootstrap.min.css我已经通过使用类似../../../node_modules/bootstrap/dist/css/bootstrap.min.css 的路径解决了这个问题

For me, I had a:对我来说,我有一个:

<base href="/index.html" />

in the index.html page, which made the normally relative links absolute-在 index.html 页面中,这使得通常的相对链接成为绝对链接-

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM