toast

弹窗小插件 gitHub

Toast

options参数列表

  • clas: “toast-wrap”,
  • text: “”,
  • outTime: 1500,
  • fadeTime: 600,
  • type: ‘toast’,
  • btn: ‘好的’,
  • callback: null,

eg1:默认 提示 ,1500s 自动关闭

1
2
var toast = new Toast({text:'确定要继续吗?'});
toast.create();

eg2:默认 提示 ,1500s 自动关闭

1
2
3
4
5
6
var toast = new Toast({text:'确定要继续吗?',type:'noToast',callback:afterToast});
toast.create();

function afterToast () {
console.log('yes');
}

Confirm

options参数列表

  • clas: ‘confirm-wrap’,
  • cover: true,
  • title: ‘标题’,
  • content: ‘正文’,
  • cancel: ‘cancel’,
  • sub: ‘ok’,
  • html: ‘’,
  • wrap: ‘modal-cover’,
  • cancelCall: null,
  • subCall: null,

eg1:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var confim = new Confirm({
content:'您已经中奖了',
title:'中奖通知',
cancel:'放弃',
sub:'领奖',
cancelCall:cancelTap,
subCall:subTap
})
confim.create();

function () {
console.log('no');
}

function subTap () {
console.log('yes');
}

有问题欢迎issue 戳 gitHub