mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 09:34:07 -08:00
27 lines
669 B
TypeScript
27 lines
669 B
TypeScript
|
import Vue from 'vue';
|
||
|
|
||
|
import { Notification } from 'element-ui';
|
||
|
import { ElNotificationOptions } from 'element-ui/types/notification';
|
||
|
|
||
|
// export const showMessage = {
|
||
|
export const showMessage = Vue.extend({
|
||
|
methods: {
|
||
|
$showMessage (messageData: ElNotificationOptions) {
|
||
|
messageData.dangerouslyUseHTMLString = true;
|
||
|
if (messageData.position === undefined) {
|
||
|
messageData.position = 'bottom-right';
|
||
|
}
|
||
|
|
||
|
return Notification(messageData);
|
||
|
},
|
||
|
$showError (error: Error, title: string, message: string) {
|
||
|
this.$showMessage({
|
||
|
title,
|
||
|
message: `${message}<br /><i>${error.message}</i>`,
|
||
|
type: 'error',
|
||
|
duration: 0,
|
||
|
});
|
||
|
},
|
||
|
},
|
||
|
});
|