mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
48 lines
785 B
Vue
48 lines
785 B
Vue
|
<template>
|
||
|
<fragment></fragment>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import mixins from 'vue-typed-mixins';
|
||
|
|
||
|
import { showMessage } from './mixins/showMessage';
|
||
|
import { ElMessageComponent } from 'element-ui/types/message';
|
||
|
|
||
|
export default mixins(
|
||
|
showMessage,
|
||
|
).extend({
|
||
|
name: 'PageAlert',
|
||
|
props: {
|
||
|
message: {
|
||
|
type: String,
|
||
|
required: true,
|
||
|
},
|
||
|
popupClass: {
|
||
|
type: String,
|
||
|
},
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
alert: null as null | ElMessageComponent,
|
||
|
};
|
||
|
},
|
||
|
mounted() {
|
||
|
this.alert = this.$showAlert({
|
||
|
message: this.message,
|
||
|
type: 'warning',
|
||
|
duration: 0,
|
||
|
showClose: true,
|
||
|
dangerouslyUseHTMLString: true,
|
||
|
// @ts-ignore
|
||
|
customClass: this.popupClass || '',
|
||
|
});
|
||
|
},
|
||
|
beforeDestroy() {
|
||
|
if (this.alert) {
|
||
|
this.alert.close();
|
||
|
}
|
||
|
},
|
||
|
});
|
||
|
</script>
|
||
|
|