0
点赞
收藏
分享

微信扫一扫

禁用yii2.0默认加载jQuery库,加载自己的js库

In main.php config file add the following code into components array:

'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
] ,
'assetManager' => [
'bundles' => [
/*// 禁用 (bootstrap.css)
'yii\bootstrap\BootstrapAsset' => [
'css' => [], ] ,
// 禁用 JS (bootstrap.js)
'yii\bootstrap\BootstrapPluginAsset' => [
'js' =>[]
],
// 禁用 JQuery (jquery.js)
'yii\web\JqueryAsset' => [
'js' =>[]
],*/
// 改变默认加载的jQuery版本
'yii\web\JqueryAsset' => [
'sourcePath' => null,
'basePath' => '@webroot',
'baseUrl' => '@web',
'js' => [
'js' => [
// 开发模式下不加载 .min压缩文件
YII_ENV_DEV ? 'js/jquery-1.11.3.js' : 'js/jquery-1.11.3.min.js' ,
]
]
],
] ,
] ,
],



举报

相关推荐

0 条评论