maestro-server/bootue

View on GitHub
src/toast/script.js

Summary

Maintainability
A
0 mins
Test Coverage

import 'izitoast/dist/css/iziToast.min.css'

export default {
  name: 'toast',

  methods: {
    callToast (type, title, message) {
      type = type.charAt(0).toUpperCase() + type.slice(1);
      const method = `show${type}Msg`
      this[method]({title, message})
    }
  },

  notifications: {
    showSuccessMsg: {
      type: 'success'
    },

    showInfoMsg: {
      type: 'info'
    },

    showWarningMsg: {
      type: 'warning'
    },

    showDangerMsg: {
      type: 'error'
    }
  }
}