layer 的功能

1.layer.alert()spa

  

layer.alert('',{
     title: "<div style='color:red;margin-left:20px;font-size:20px;text-align: center;font-weight:bold;width:100%'>重要通知</div>",
     content: 'hello layer',
    btn:['確認','取消'],
     btn1:function(){
       alert('已完成')
     }
   });  

2.layer.open()code

  

layer.open({
     title: "<div style='color:red;margin-left:20px;font-size:20px;text-align: center;font-weight:bold;width:100%'>重要通知</div>",
     content: 'hello layer',
    btn:['確認','取消'],
     
   });  

 

3. laryer.msg()blog

  

layer.msg('同上', {
  icon: 1,
  time: 2000 //2秒關閉(若是不配置,默認是3秒)
}, function(){
  //do something
}); 

相關文章
相關標籤/搜索