18 lines
431 B
JavaScript
18 lines
431 B
JavaScript
import { Controller } from '@hotwired/stimulus'
|
|
import Toastify from 'toastify-js'
|
|
|
|
export default class extends Controller {
|
|
|
|
static values = { text: String, class: String }
|
|
|
|
connect() {
|
|
Toastify({
|
|
duration: 5000,
|
|
text: this.textValue,
|
|
gravity: 'top',
|
|
position: 'right',
|
|
className: this.classValue,
|
|
close: true,
|
|
}).showToast()
|
|
}
|
|
} |