public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/require").Include(
"~/Scripts/require.js"));
....
并在 _Layout.cshtml
@Scripts.Render("~/bundles/require")
它呈现为(带EnableOptimizations = false
):
<script src="/Scripts/require.js"></script>
但我想添加一个属性
<script src="/Scripts/require.js" data-main="/Scripts/main"></script>
我怎么能那样做?