refactor(editor): Turn showMessage mixin to composable (#6081)
* 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
This commit is contained in:
@@ -3,13 +3,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
import { showMessage } from '@/mixins/showMessage';
|
||||
import type { ElMessageComponent } from 'element-ui/types/message';
|
||||
import { defineComponent } from 'vue';
|
||||
import type { ElNotificationComponent } from 'element-ui/types/notification';
|
||||
import { sanitizeHtml } from '@/utils';
|
||||
import { useToast } from '@/composables';
|
||||
|
||||
export default mixins(showMessage).extend({
|
||||
export default defineComponent({
|
||||
name: 'PageAlert',
|
||||
props: {
|
||||
message: {
|
||||
@@ -20,19 +19,24 @@ export default mixins(showMessage).extend({
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
...useToast(),
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
alert: null as null | ElMessageComponent,
|
||||
alert: null as null | ElNotificationComponent,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.alert = this.$showAlert({
|
||||
this.alert = this.showAlert({
|
||||
title: '',
|
||||
message: sanitizeHtml(this.message),
|
||||
type: 'warning',
|
||||
duration: 0,
|
||||
showClose: true,
|
||||
dangerouslyUseHTMLString: true,
|
||||
// @ts-ignore
|
||||
customClass: this.popupClass || '',
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user