本文整理汇总了TypeScript中sweetalert2.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: alert
alert(options: any = {}, successCb = noop, closeCb = noop) {
const defaultOptions: any = {
type: options.type || null,
title: options.title || null,
text: options.text || null,
buttonsStyling: options.buttonsStyling || false,
confirmButtonClass : options.confirmButtonClass || 'btn btn-lg btn-secondary',
animation: options.animation || true,
customClass: options.customClass || '',
}
if (closeCb !== noop) {
defaultOptions.showCancelButton = options.showCancelButton || true
defaultOptions.cancelButtonClass = options.cancelButtonClass || 'btn btn-lg btn-secondary'
}
return swal(assign(defaultOptions, options))
.then(res => successCb(res), dismiss => closeCb(dismiss))
}
开发者ID:beeman,项目名称:loopback-angular-admin,代码行数:19,代码来源:ui.service.ts
示例2: Error
export const getUser = (): UserData => {
const user = sessionStorage.getItem('auth_token');
if (user === null) {
logOff();
swal({
type: 'error',
title: 'Por favor, efetue login novamente',
text: 'Sua sessão expirou!'
});
window.location.href = '/login';
throw new Error('Sua sessão expirou');
}
try {
return JSON.parse(user) as UserData;
} catch (error) {
logOff();
swal({
type: 'error',
title: 'Por favor, efetue login novamente',
text: 'Sua sessão expirou!'
});
window.location.href = '/login';
throw error;
}
};
开发者ID:juninmd,项目名称:fatec-hospital-web,代码行数:26,代码来源:auth.util.ts
示例3: Swal
msg(type: any, title: any) {
return Swal({
type: type,
title: title,
showConfirmButton: false,
timer: 1500
});
}
开发者ID:eluizbr,项目名称:ngCurso,代码行数:8,代码来源:edit-users.component.ts
示例4: show
private show(msg: string, options: SweetAlertOptions) {
console.warn(msg);
return swal({
html: msg,
...options
});
}
开发者ID:andrask,项目名称:CloudFlow,代码行数:8,代码来源:alerts.service.ts
示例5: prettyPrompt
prettyPrompt(title,
text,
inputValue,
event_type,
data,
callback) {
swal({
title: title,
text: text,
//type: 'input',
input: 'email',
showCancelButton: true,
inputValue: inputValue
}).
then(
callback(event_type, data)
)
}
开发者ID:sinmaniphel,项目名称:scriptus_write,代码行数:18,代码来源:sweet.ts
示例6: changeClientByDialog
changeClientByDialog(client_id) {
swal({
title: 'Are you sure want to change Client?',
type: 'info',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, change it!'
}).then(() => {
this.setDefaultClientId(client_id);
}, (dismiss) => {
if (dismiss === 'cancel') {
}
});
}
开发者ID:megamtech,项目名称:angular-php-framework,代码行数:19,代码来源:header.component.ts
示例7: removeUser
removeUser(id: string) {
Swal({
title: 'Are you sure?',
text: 'You won\'t be able to revert this!',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then(result => {
this.userService.removeUser(id).subscribe(
ok => {
Swal('Deleted!', 'Your file hs been deleted.', 'success');
},
err => {
Swal('Error!', 'User not found.', 'error');
}
);
});
}
开发者ID:eluizbr,项目名称:ngCurso,代码行数:20,代码来源:list-users.component.ts
示例8: prettyConfirm
prettyConfirm(title, text, data, callback,cancel?) {
swal(
{
title: title,
text: text,
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55'
}
).then(
(result) => {
if(result.value) {
callback(data)
}
else {
if(cancel) {
cancel(data)
}
}
}
)
}
开发者ID:sinmaniphel,项目名称:scriptus_write,代码行数:23,代码来源:sweet.ts
示例9: Swal
err => {
Swal('Error!', 'User not found.', 'error');
}
开发者ID:eluizbr,项目名称:ngCurso,代码行数:3,代码来源:list-users.component.ts
注:本文中的sweetalert2.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论