How to use layui pop-up window
This article mainly introduces how to use the layui pop-up window, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
There are three types of layui pop-up windows, namely: 1, confim type; 2, open type pop-up box; 3, msg type. The following is to introduce how to use these pop-up windows one by one.
Method of using 1:confim type
Layui.use ('layer', function () {layer.confirm (' do you want to upload file information now?' , {btn: ['Yes','No'], time: 200000, / / automatically close after 20s}, function (index) {alert ("this is the callback of clicking OK button") layer.close (index);}, function () {alert ("this is the callback of clicking the cancel button");})
2:open type pop-up box, the content parameter can be a selector or a path
Layer.open ({type: 1title: "borrowing time", area: ['450pxtimes,' 300px`], content: $("# borrowCase"), btn: ['OK', 'cancel'], yes: function (index) {alert ("this is the callback for clicking the OK button")}, btn2: function () {alert ("this is the callback for clicking the cancel button")} End:function () {alert ('this is a callback that will go when any button is clicked')}) Layui.use ('layer',function () {var layer=layui.layer;layer.open ({new field information for type:2,title:'', area: ['450px'], content: "dictionary/addFiled?dictionaryId=" + dictionaryId// field type})}))
3:msg Typ
Layer.msg ('loan added successfully', {time: 1500, / / 1500ms automatically closed})
4: close the pop-up window
Layer_close (index) closes the current pop-up window parent.layer.closeAll () closes all pop-up windows. Thank you for reading this article carefully. I hope the article "how to use layui Pop-up window" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!