修改 css 加载路径判断

This commit is contained in:
贤心 2022-08-31 01:45:37 +08:00
parent 2934ab0066
commit 0d09448599
3 changed files with 24 additions and 9 deletions

View File

@ -96,4 +96,9 @@ layui.define(['lay', 'util'], function(exports){
});
});
}).addcss('modules/code.css?v=3', 'skincodecss');
});
// 若为源码版,则自动加载该组件依赖的 css 文件
if(!layui['layui.all']){
layui.addcss('modules/code.css?v=3', 'skincodecss');
}

View File

@ -24,7 +24,7 @@
//外部调用
,laydate = {
v: '5.3.1' //layDate 版本号
v: '5.4.0' //layDate 版本号
,config: {
weekStart: 0, // 默认周日一周的开始
} //全局配置项
@ -39,10 +39,17 @@
}
// 主体 CSS 等待事件
,ready: function(fn){
var cssname = 'laydate', ver = ''
,path = (isLayui ? 'modules/' : 'css/') + 'laydate.css?v='+ laydate.v + ver;
isLayui ? layui.addcss(path, fn, cssname) : ready.link(path, fn, cssname);
,ready: function(callback){
var cssname = 'laydate';
var ver = ''
var path = (isLayui ? 'modules/' : 'css/') + 'laydate.css?v='+ laydate.v + ver;
isLayui ? (
layui['layui.all']
? (typeof callback === 'function' && callback())
: layui.addcss(path, callback, cssname)
) : ready.link(path, callback, cssname);
return this;
}
}

View File

@ -120,15 +120,18 @@ var layer = {
return this;
},
//主体 CSS 等待事件
// 主体 CSS 等待事件
ready: function(callback){
var cssname = 'layer', ver = ''
,path = (isLayui ? 'modules/' : 'css/') + 'layer.css?v='+ layer.v + ver;
var cssname = 'layer';
var ver = '';
var path = (isLayui ? 'modules/' : 'css/') + 'layer.css?v='+ layer.v + ver;
isLayui ? (
layui['layui.all']
? (typeof callback === 'function' && callback())
: layui.addcss(path, callback, cssname)
) : ready.link(path, callback, cssname);
return this;
},