diff --git a/src/components/index.js b/src/components/index.js index 1487e15..648af3e 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,3 +1,6 @@ import Vue from 'vue' +import notify from './notification' + +Vue.prototype.$notify = notify Vue.component('markdown', () => import('./markdown')) diff --git a/src/components/notification/index.js b/src/components/notification/index.js new file mode 100644 index 0000000..0d1fa3d --- /dev/null +++ b/src/components/notification/index.js @@ -0,0 +1,13 @@ +import { Notification } from "element-ui"; +import i18n from "@/i18n"; + +const notify = ({ title, message, type, duration }) => { + Notification({ + title: i18n.t(title), + message: i18n.t(message), + type: type, + duration: duration, + }); +}; + +export default notify;