當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript sweetalert2.default函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。