From 1223646b7b4edc53c7e7b130b44a827abc103d1a Mon Sep 17 00:00:00 2001 From: Aicirou <2643053021@qq.com> Date: Sat, 4 Jul 2020 22:55:33 +0800 Subject: [PATCH] :zap:Package notification component --- src/components/index.js | 3 +++ src/components/notification/index.js | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/components/notification/index.js 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;