You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
987 B

import { Controller } from "@hotwired/stimulus"
import Toastify from 'toastify-js'
// Connects to data-controller="flash"
export default class extends Controller {
count = 0
connect() {
console.log('FLASH stimulus ready!')
}
notice() {
console.warn('show notice')
Toastify({
text: `This is toast #${this.count++} + a long message which should wrap over 2 or more lines`,
className: 'alert alert-success inset-ring-2 shadow-xl/30',
close: true,
position: 'center',
// gravity: "top", // `top` or `bottom`
// stopOnFocus: true, // Prevents dismissing of toast on hover
// duration: 3000,
offset: {
// x: 50, // horizontal axis - can be a number or a string indicating unity. eg: '2em'
y: 30 // vertical axis - can be a number or a string indicating unity. eg: '2em'
},
}).showToast();
}
alert() {
console.warn('show alert')
}
random() {
console.warn('show randow')
}
}