我在Yii2工作并拥有jQuery 3.我已经安装了一个需要jQuery 2的扩展程序。
AppAsset
更改jQuery?我现在AppAsset
:class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css', // my css
];
public $js = [
'js/site.js', // my js
'js/jquery-2.2.2.min.js // LIBRARY THAT require WIDGET
];
public $depends = [
'yii\web\YiiAsset', // jquery for yii2
'yii\bootstrap\BootstrapPluginAsset', // js, css, jquery for bootstrap
];
}
或如何在配置上进行更改:
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => null,
'basePath' => '@webroot',
'baseUrl' => '@web',
'js' => [
'jquery-2.2.2.min.js',
]
],
],
],