对于ASP .NET Core 2.1(Visual Studio 15.8或更高版本),
{ "version": "1.0", "defaultProvider": "cdnjs", "libraries": [ { "library": "jqueryui@1.12.1", "destination": "wwwroot/lib/jquery-ui/" } ] }
来源: https://learn.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-2.1
现在在Visual Studio 2019(版本16.2.2)中,您可以添加客户端库。
1- 在项目上右键点击,选择添加侧边栏菜单
2- 点击客户端库。(会弹出一个菜单)
3- 搜索您想要安装的库,然后设置保存库所有文件的位置。
4- 然后按安装按钮
5- 尽情编码(:
Right-click on wwwroot/lib-->Add--> client-side Library (note: you can add each library in the wwwroot folder, but in this scenario, it is better add it in the lib folder near other jQuery files) client-side Library windows
Provider: You can use the default provider or change it.
Library: Write the name of the library you want to add as an example JQuery UI. There is an IntelliSense in this text box that helps you to write the name of your library.
Select Files: If you want to install light-weight pure jquery-UI without themes, just select these items. pure JQuery_UI
Then in the Views/ Shared/ _Layout.cshtml add .css file to head:
<head>
<link rel="stylesheet" href="~/lib/jqueryui/jquery-ui.min.css"/>
</head>
Add .js file to body :
<body>
<script src="~/lib/jqueryui/jquery-ui.min.js"></script>
</body>
jquery-ui
,但里面没有任何有用的东西! - Auspexpackage.json
文件,然后npm将运行以获取依赖项。我认为我没有做任何特殊的事情来获得这个功能。 - Auspex{
"directory" : "wwwroot/lib"
}