调用 layer.open 方法时,没有弹框动作;layer.open 不弹框
- 确认是否有逻辑报错;
- 依赖包是否引入成功或正确;
- 调用 layer.open 入参的元素id设置不能与html文档内其他元素 id 设置重复。
function layerAdd() {
layer.open({
type: 1,
skin: 'layerAdd',
title: tempForm.id ? "设备编辑" : "设备添加",
offset: 'auto',
id: 'addModalBox',
content: $("#addModal"),
area: ['1206px', '570px'],
btn: ['提交', '取消'],
btn1(index, layero) {
},
btn2(index, layero) {
tempForm = {}
layer.close(index)
return false
},
btnAlign: 'r',
shade: 0.3,
success: function (layero) {
console.log('success')
},
cancel() {
}
})
}