gpt4 book ai didi

twitter-bootstrap - 我应该将静态文件放在我的 React.JS 应用程序的什么位置?

转载 作者:行者123 更新时间:2023-12-04 03:12:38 26 4
gpt4 key购买 nike

我跑了 create-react-app我用 public 得到了通常的结构, src和javascript文件。一切都很好。

现在我想向其中添加 Bootstrap3,但我想添加普通的 css/js/font 文件夹,并创建我自己的使用 Bootstrap 的组件。

问题是;我应该把文件放在哪里?
public里面文件夹,或在 src

我假设我只是通过添加 <script> 以正常方式引用它们和 <link> public/index.html 中的标签?

谢谢。

最佳答案

这来自 create-react-app 文档。

Inside index.html, you can use it like this:

<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">

Only files inside the public folder will be accessible by %PUBLIC_URL% prefix

因此,您可以将您的 css 添加到 public 文件夹中,然后使用带有 %PUBLIC_URL% url 前缀的标签添加它

关于twitter-bootstrap - 我应该将静态文件放在我的 React.JS 应用程序的什么位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43782105/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com