feat: Replace new Vue() with custom event bus (no-changelog) (#5780)
* refactor: replace new Vue() with custom event bus (no-changelog) * fix: export types from design system main * fix: update component types * fix: update form inputs event bus
This commit is contained in:
@@ -33,11 +33,11 @@ import mixins from 'vue-typed-mixins';
|
||||
|
||||
import { showMessage } from '@/mixins/showMessage';
|
||||
import Modal from './Modal.vue';
|
||||
import Vue from 'vue';
|
||||
import { IFormInputs } from '@/Interface';
|
||||
import { CHANGE_PASSWORD_MODAL_KEY } from '../constants';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUsersStore } from '@/stores/users';
|
||||
import { createEventBus } from '@/event-bus';
|
||||
|
||||
export default mixins(showMessage).extend({
|
||||
components: { Modal },
|
||||
@@ -50,8 +50,8 @@ export default mixins(showMessage).extend({
|
||||
data() {
|
||||
return {
|
||||
config: null as null | IFormInputs,
|
||||
formBus: new Vue(),
|
||||
modalBus: new Vue(),
|
||||
formBus: createEventBus(),
|
||||
modalBus: createEventBus(),
|
||||
password: '',
|
||||
loading: false,
|
||||
CHANGE_PASSWORD_MODAL_KEY,
|
||||
@@ -133,14 +133,14 @@ export default mixins(showMessage).extend({
|
||||
message: this.$locale.baseText('auth.changePassword.passwordUpdatedMessage'),
|
||||
});
|
||||
|
||||
this.modalBus.$emit('close');
|
||||
this.modalBus.emit('close');
|
||||
} catch (error) {
|
||||
this.$showError(error, this.$locale.baseText('auth.changePassword.error'));
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
onSubmitClick() {
|
||||
this.formBus.$emit('submit');
|
||||
this.formBus.emit('submit');
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user