gpt4 book ai didi

jquery - 我是否总是需要显式捆绑 jQuery UI 的所有样式?

转载 作者:行者123 更新时间:2023-11-28 08:03:17 26 4
gpt4 key购买 nike

我遇到过很多文章指出我需要显式捆绑每个 jQueryUI .css 文件,例如How to add jQueryUI library in MVC 5 project? 的公认答案.然而,当我查看由 Nuget 创建的 Content/themes/base 文件夹中的 .css 文件时,我看到文件 all.css,它有效地包括所有其他文件。

对我来说,仅捆绑 all.css 文件似乎更简单,但我想知道此文件中使用的 css @import 指令是否仍然有效正如脚本包中预期的那样。

最佳答案

据我所知,添加对 jquery.ui.all.css 的引用就可以了。

但是,我会说大多数时候不需要整个库。在您的初始配置中明确说明(即添加每个使用过的样式引用)将使您以后可以轻松删除/注释您不需要或不使用的引用。它还将使其他开发人员更容易识别该包中真正包含的引用。

关于 jquery ui 样式包命名的一个小警告:

[..] you need to make sure your CSS bundle names are similar to the physical directory structure of your application. When installing the jQuery UI nuget package, it will put your stylesheets in the directory /content/themes/base/ so you should name your bundle "~/content/themes/base/jqueryui" to make sure that everything [sprites/images] works.

关于jquery - 我是否总是需要显式捆绑 jQuery UI 的所有样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29622760/

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