“Сладкое предупреждение 2” Ответ

Sweet Alert 2 Do Date на подтверждении

Swal.fire({  
  title: 'Do you want to save the changes?',  
  showDenyButton: true,  showCancelButton: true,  
  confirmButtonText: `Save`,  
  denyButtonText: `Don't save`,
}).then((result) => {  
	/* Read more about isConfirmed, isDenied below */  
    if (result.isConfirmed) {    
    	Swal.fire('Saved!', '', 'success')  
    } else if (result.isDenied) {    
    	Swal.fire('Changes are not saved', '', 'info')  
 	}
});
Orbit Tuner

SweetAlert Angular 8

npm install --save sweetalert2
Helpless Hare

Swal Fire Types

swal({
  title: "Are you sure?",
  text: "Your will not be able to recover this imaginary file!",
  type: "danger",
  showCancelButton: true,
  confirmButtonClass: "btn-danger",
  confirmButtonText: "Yes, delete it!",
  closeOnConfirm: false
},
function(){
  swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
Worrisome Whale

Сладкое предупреждение 2

npm install sweetalert2

// ES6 Modules or TypeScript
import Swal from 'sweetalert2'

// CommonJS
const Swal = require('sweetalert2')

const Toast = Swal.mixin({
  toast: true,
  position: 'top-end',
  showConfirmButton: false,
  timer: 3000,
  timerProgressBar: true,
  didOpen: (toast) => {
    toast.addEventListener('mouseenter', Swal.stopTimer)
    toast.addEventListener('mouseleave', Swal.resumeTimer)
  }
})



Use 
Toast.fire({
  icon: 'success',
  title: 'Signed in successfully'
})
YellowSnowman85

Сладкое предупреждение 2

npm install sweetalert2

// ES6 Modules or TypeScript
import Swal from 'sweetalert2'

// CommonJS
const Swal = require('sweetalert2')

const Toast = Swal.mixin({
  toast: true,
  position: 'top-end',
  showConfirmButton: false,
  timer: 3000,
  timerProgressBar: true,
  didOpen: (toast) => {
    toast.addEventListener('mouseenter', Swal.stopTimer)
    toast.addEventListener('mouseleave', Swal.resumeTimer)
  }
})



Use 
Toast.fire({
  icon: 'success',
  title: 'Signed in successfully'
})
YellowSnowman85

Сладкое предупреждение 2

let timerInterval
Swal.fire({
  title: 'Auto close alert!',
  html: 'I will close in <b></b> milliseconds.',
  timer: 2000,
  timerProgressBar: true,
  didOpen: () => {
    Swal.showLoading()
    const b = Swal.getHtmlContainer().querySelector('b')
    timerInterval = setInterval(() => {
      b.textContent = Swal.getTimerLeft()
    }, 100)
  },
  willClose: () => {
    clearInterval(timerInterval)
  }
}).then((result) => {
  /* Read more about handling dismissals below */
  if (result.dismiss === Swal.DismissReason.timer) {
    console.log('I was closed by the timer')
  }
})
husseinpenart

Ответы похожие на “Сладкое предупреждение 2”

Вопросы похожие на “Сладкое предупреждение 2”

Больше похожих ответов на “Сладкое предупреждение 2” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования