Merge remote-tracking branch 'origin/main'

pull/1128/head
sunxiaobin89 2 years ago
commit 63250383ce

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>完整库使用 - layui</title> <title>完整库使用 - layui</title>
<link rel="stylesheet" href="../src/css/layui.css"> <link rel="stylesheet" href="../dist/css/layui.css">
<style> <style>
body{padding: 10px;} body{padding: 10px;}
@ -187,7 +187,7 @@ layui.use(function(){
}); });
} }
,'test-use': function(othis){ ,'test-use': function(othis){
layui.use(['laytpl','laypage','laydate','jquery','layer','util','element','upload','slider','colorpicker','form','tree','transfer','table','carousel','rate','flow','layedit','code'], function(){ layui.use(['laytpl','laypage','laydate','jquery','layer','util','element','upload','slider','colorpicker','form','tree','transfer','table','carousel','rate','flow','code'], function(){
layer.tips('请观察 Network 是否有重复加载 js 文件。如果没有任何新的请求,则代表正常。', othis, { layer.tips('请观察 Network 是否有重复加载 js 文件。如果没有任何新的请求,则代表正常。', othis, {
time: 10*1000 time: 10*1000
}); });

@ -17,11 +17,11 @@ const yargs = require('yargs');
const config = { const config = {
//注释 //注释
comment: [ comment: [
'/** <%= pkg.version %> | <%= pkg.license %> Licensed */<%= js %>' '/** v<%= pkg.version %> | <%= pkg.license %> Licensed */<%= js %>'
,{pkg: pkg, js: ';'} ,{pkg: pkg, js: ';'}
] ]
//模块 //模块
,modules: 'lay,laytpl,laypage,laydate,jquery,layer,util,dropdown,slider,colorpicker,element,upload,form,table,tree,transfer,carousel,rate,flow,layedit,code' ,modules: 'lay,laytpl,laypage,laydate,jquery,layer,util,dropdown,slider,colorpicker,element,upload,form,table,tree,transfer,carousel,rate,flow,code'
}; };
// 获取参数 // 获取参数
@ -60,13 +60,14 @@ const js = () => {
// css // css
const css = () => { const css = () => {
let src = [ let src = [
'./src/css/**/*.css' './src/css/layui.css',
,'!./src/css/**/font.css' './src/css/modules/**/*.css',
'!./src/css/**/font.css'
]; ];
return gulp.src(src).pipe(cleanCSS({ return gulp.src(src).pipe(cleanCSS({
compatibility: 'ie8' compatibility: 'ie8'
})) }))
//.pipe(concat('layui.css', {newLine: ''})) .pipe(concat('layui.css', {newLine: ''}))
.pipe(gulp.dest(dest +'/css')); .pipe(gulp.dest(dest +'/css'));
}; };
@ -113,14 +114,13 @@ exports.rls = gulp.series(cleanRLS, rls); //release task
exports.layer = () => { // gulp layer exports.layer = () => { // gulp layer
let dest = './release/layer'; let dest = './release/layer';
gulp.src('./src/css/modules/layer/default/*') gulp.src('./src/css/modules/layer.css')
.pipe(gulp.dest(dest + '/src/theme/default')); .pipe(gulp.dest(dest + '/src'));
return gulp.src('./src/modules/layer.js') return gulp.src('./src/modules/layer.js')
.pipe(gulp.dest(dest + '/src')); .pipe(gulp.dest(dest + '/src'));
}; };
// laydate task // laydate task
exports.laydate = () => { // gulp laydate exports.laydate = () => { // gulp laydate
let dest = './release/laydate/'; // 发行目录 let dest = './release/laydate/'; // 发行目录
@ -131,7 +131,7 @@ exports.laydate = () => { // gulp laydate
// css // css
gulp.src('./src/css/modules/laydate.css') gulp.src('./src/css/modules/laydate.css')
.pipe(gulp.dest(dest + 'src/')); .pipe(gulp.dest(dest + 'src'));
// js // js
return gulp.src(['./src/layui.js', './src/modules/{lay,laydate}.js']) return gulp.src(['./src/layui.js', './src/modules/{lay,laydate}.js'])

@ -1,6 +1,6 @@
{ {
"name": "layui", "name": "layui",
"version": "2.7.6", "version": "2.8.0-beta.1",
"description": "Classic modular Front-End UI library", "description": "Classic modular Front-End UI library",
"main": "dist/layui.js", "main": "dist/layui.js",
"license": "MIT", "license": "MIT",

@ -15,7 +15,7 @@
} }
,Layui = function(){ ,Layui = function(){
this.v = '2.7.6'; // layui 版本号 this.v = '2.8.0-beta.1'; // Layui 版本号
} }
//识别预先可能定义的指定全局对象 //识别预先可能定义的指定全局对象

@ -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');
}

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

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

Loading…
Cancel
Save