import { Controller } from "@hotwired/stimulus"

// Connects to data-controller="toast"
export default class extends Controller {
  connect() {
    // 3秒后自动隐藏
    setTimeout(() => {
      this.element.classList.add('animate-fade-out')
      setTimeout(() => {
        this.element.remove()
      }, 500)
    }, 3000)
  }
}
