Files
myep-team/assets/controllers/toast_controller.js
T
2023-09-18 13:10:20 +02:00

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()
}
}