mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 01:24:05 -08:00
b95fcd7323
* refactor(editor): move $getExecutionError from showMessages mixin to pushConnection (it is used there only) * refactor(editor): resolve showMessage mixin methods * fix(editor): use composable instead of mixin * fix(editor): resolve conflicts * fix(editor): replace clearAllStickyNotifications * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): remove last confirmMessage usage * fix(editor): remove $prompt usage * fix(editor): remove $show methods * fix(editor): lint fix * fix(editor): lint fix * fix(editor): fixes after review
50 lines
877 B
Vue
50 lines
877 B
Vue
<template>
|
|
<fragment></fragment>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import type { ElNotificationComponent } from 'element-ui/types/notification';
|
|
import { sanitizeHtml } from '@/utils';
|
|
import { useToast } from '@/composables';
|
|
|
|
export default defineComponent({
|
|
name: 'PageAlert',
|
|
props: {
|
|
message: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
popupClass: {
|
|
type: String,
|
|
},
|
|
},
|
|
setup() {
|
|
return {
|
|
...useToast(),
|
|
};
|
|
},
|
|
data() {
|
|
return {
|
|
alert: null as null | ElNotificationComponent,
|
|
};
|
|
},
|
|
mounted() {
|
|
this.alert = this.showAlert({
|
|
title: '',
|
|
message: sanitizeHtml(this.message),
|
|
type: 'warning',
|
|
duration: 0,
|
|
showClose: true,
|
|
dangerouslyUseHTMLString: true,
|
|
customClass: this.popupClass || '',
|
|
});
|
|
},
|
|
beforeDestroy() {
|
|
if (this.alert) {
|
|
this.alert.close();
|
|
}
|
|
},
|
|
});
|
|
</script>
|