请使用whale.layer模块内调用
- Source:
Methods
-
<inner> close(idxOrDom)
-
关闭弹层
Parameters:
Name Type Description idxOrDomNumber | Object 要关闭的弹层dom或者对应idx
- Source:
Example
layer.close(1);
-
<inner> closeLoading()
-
关闭加载层, 和layer.showLoading配套使用
- Source:
-
<inner> open(config)
-
弹出弹层
Parameters:
Name Type Description configObject 配置
- Source:
Properties:
Name Type Description config.contentString 弹出层的innerHTML
config.selString 弹出层选择器
Example
//使用选择器弹出 layer.open({ sel: '#poplayer' }); //传入content参数 layer.open({ content: '<div class="poplayer">我是弹层</div>' }); -
<inner> showLoading(text)
-
显示加载层
Parameters:
Name Type Description textString 加载文字
- Source:
Example
layer.showLoading('正在加载'); -
<inner> showMsgBox(title, content, sureOrCancelText, sureOrCancelFunc, sureText, sureFunc)
-
显示MessageBox
Parameters:
Name Type Description titleString 标题
contentString 内容
sureOrCancelTextString 确定或者取消按钮
sureOrCancelFuncfunction 确定或者取消按钮的回调
sureTextString 确定按钮
sureFuncfunction 确定按钮回调
- Source:
Example
layer.showMsgBox('温馨提示','确定删除吗','确定', null, '取消', null); layer.showMsgBox('温馨提示','确定删除吗','确定', function(){}); -
<inner> showToast(content, delay, style)
-
弹出Toast(从中间弹出)
Parameters:
Name Type Description contentString 提示内容
delayNumber 显示时间(秒), 只能传递3-5之内的数字
styleString 附加样式
- Source:
Example
//一个参数 layer.showToast2('通知成功'); //2个参数 layer.showToast2('通知成功',3); -
<inner> showToast2(content, delay, style)
-
弹出Toast(从底部弹出)
Parameters:
Name Type Default Description contentString 提示内容
delayNumber 3 显示时间(秒), 只能传递3-5之内的数字
styleString 附加样式
- Source:
Example
//一个参数 layer.showToast2('通知成功'); //2个参数 layer.showToast2('通知成功',3);