PC版layer提示
/*
icon: 0 感叹号
icon: 1 ok
icon: 2 error
icon: 3 问号
icon: 4 锁
icon: 5 失落表情
icon: 6 开心表情
*/
------alert提示
layer.alert('请输入你需要查询的内容!', {icon: 0,title:'提示'}); //提示
layer.alert('请输入你需要查询的内容!', {icon: 1,title:'提示'}); //成功
layer.alert('请输入你需要查询的内容!', {icon: 2,title:'提示'}); //失败
layer.alert('请输入你需要查询的内容!', {icon: 3,title:'提示'}); //提问
layer.alert('请输入你需要查询的内容!', {icon: 4,title:'提示'}); //锁
layer.alert('请输入你需要查询的内容!', {icon: 5,title:'提示'}); //失落表情
layer.alert('请输入你需要查询的内容!', {icon: 6,title:'提示'}); //开心表情
layer.alert('请输入你需要查询的内容!', {icon: 0,title:'提示'},function(index){
layer.close(index);
window.location.reload();
});
layer.alert('请输入你需要查询的内容!', {icon: 1,title:'提示'},function(index){
layer.close(index);
window.location.reload();
});
layer.alert('登录已超时,请重新登录!', {icon: 0,title:'提示'},function(index){
layer.close(index);
window.location.href = " ";
});
------confirm提示
layer.confirm('您已离线,是否去登录?', {icon: 3, title:'提示'}, function(index){
layer.close(index);
window.location.href = " ";
});
layer.confirm('提示询问的内容?', {icon: 3, title:'提示'}, function(index){
layer.close(index);
window.location.href = "";
});
----msg提示
layer.msg('只想弱弱提示!');
layer.msg('有表情地提示;2秒后关闭,默认3秒!', {icon: 5,time: 2000,title:'提示' });
layer.msg('有表情地提示 关闭后想做些什么;2秒后关闭,默认3秒!', {icon: 5,time: 2000,title:'提示' }), function(){
//do something
};
layer.open({
type: 1
,offset: 'auto' //具体配置参考:https://www.layui.site/doc/modules/layer.html#offset
,title: '提示'
,content: '请输入你需要查询的内容!'
,btn: '关闭'
,btnAlign: 'c' //按钮居中
,shade: 0 //不显示遮罩
,yes: function(){
layer.closeAll();
}
});
//询问框
layer.open({
type: 1
,offset: 'auto' //具体配置参考:https://www.layui.site/doc/modules/layer.html#offset
,title: '系统提示'
,content: '您已离线,请先登录?'
,btn: ['登录', '取消']
,btnAlign: 'c' //按钮居中
,shade: 0 //不显示遮罩
,yes: function(index){
window.location.href = " ";
layer.close(index);
return;
}
});