我有一个 superfish jquery 插件,它有 4 个 js 和 1 个 css:
<script src="~/Scripts/JQ_Addons/SuperFish/jquery.bgiframe.min.js"></script>
<script src="~/Scripts/JQ_Addons/SuperFish/hoverIntent.js"></script>
<script src="~/Scripts/JQ_Addons/SuperFish/supersubs.js"></script>
<script src="~/Scripts/JQ_Addons/SuperFish/superfish.js"></script>
<link href="~/Scripts/JQ_Addons/SuperFish/superfish.css" rel="stylesheet" />
我想为所有这些创建一个包,但是当我调用 bundles.Add() 时,它只能添加一种类型的包,ScriptBundle
或者StyleBundle
.
bundles.Add(new ScriptBundle("~/bundles/superfish").Include(
"~/Scripts/JQ_Addons/SuperFish/jquery.bgiframe.min.js",
"~/Scripts/JQ_Addons/SuperFish/hoverIntent.js",
"~/Scripts/JQ_Addons/SuperFish/supersubs.js",
"~/Scripts/JQ_Addons/SuperFish/superfish.js")); // I can not add css here
在视图中,我只能选择渲染一种类型的包:
@Styles.Render or @Script.Render
所以,我的问题是:是否可以只创建一个包含 js 和 css 的捆绑规则?在我看来,我想要类似的东西:
@Bundles.Render("~/bundles/superfish")