mirror of https://github.com/layui/layui
wip(i18n): 修复打包后 laydate 和 layer 异常
parent
cc222d9d22
commit
383baf471a
|
@ -177,7 +177,7 @@
|
|||
,isPreview: true //是否显示值预览
|
||||
,btns: ['clear', 'now', 'confirm'] //右下角显示的按钮,会按照数组顺序排列
|
||||
// 为实现 lang 选项就近生效,去除此处的默认值,原型 lang() 方法中有兜底值
|
||||
,lang: isLayui && layui.cache.i18n.locale //语言,只支持cn/en,即中文和英文
|
||||
,lang: '' //语言,只支持cn/en,即中文和英文
|
||||
,theme: 'default' //主题
|
||||
,position: null //控件定位方式定位, 默认absolute,支持:fixed/absolute/static
|
||||
,calendar: false //是否开启公历重要节日,仅支持中文版
|
||||
|
@ -286,9 +286,17 @@
|
|||
}else{
|
||||
window.console && console.log && console.log('layui[laydate]: Locale "' + i18n.locale + '" not found. Please add i18n messages for this locale first.');
|
||||
}
|
||||
// 同步 locale
|
||||
if(!options.lang){
|
||||
options.lang = i18n.locale;
|
||||
}
|
||||
}
|
||||
|
||||
return text[options.lang] || text['cn'];
|
||||
if(!options.lang) {
|
||||
options.lang = 'cn'
|
||||
};
|
||||
|
||||
return text[options.lang];
|
||||
};
|
||||
|
||||
Class.prototype.markerOfChineseFestivals = {
|
||||
|
|
|
@ -161,8 +161,6 @@ var $t = isLayui
|
|||
return result;
|
||||
};
|
||||
|
||||
// default btnText 需要在 $t 之后初始化
|
||||
ready.btn = [$t('lay.layer.confirm'), $t('lay.layer.cancel')];
|
||||
|
||||
|
||||
// 默认内置方法。
|
||||
|
@ -228,7 +226,7 @@ var layer = {
|
|||
}
|
||||
return layer.open($.extend({
|
||||
content: content,
|
||||
btn: ready.btn,
|
||||
btn: [$t('lay.layer.confirm'), $t('lay.layer.cancel')],
|
||||
yes: yes,
|
||||
btn2: cancel
|
||||
}, type ? {} : options));
|
||||
|
@ -291,6 +289,8 @@ var Class = function(setings){
|
|||
var that = this, creat = function(){
|
||||
that.creat();
|
||||
};
|
||||
// TODO 临时的同步方案
|
||||
ready.config.title = $t('lay.layer.defaultTitle');
|
||||
that.index = ++layer.index;
|
||||
that.config.maxWidth = $(win).width() - 15*2; // 初始最大宽度:当前屏幕宽,左右留 15px 边距
|
||||
that.config = $.extend({}, that.config, ready.config, setings);
|
||||
|
@ -522,7 +522,7 @@ Class.pt.creat = function(){
|
|||
|
||||
switch(config.type){
|
||||
case 0:
|
||||
config.btn = ('btn' in config) ? config.btn : ready.btn[0];
|
||||
config.btn = ('btn' in config) ? config.btn : $t('lay.layer.confirm');
|
||||
layer.closeAll('dialog');
|
||||
break;
|
||||
case 2:
|
||||
|
|
Loading…
Reference in New Issue