scinote-web/app/javascript/vue/shared/modal_mixin.js

26 lines
492 B
JavaScript
Raw Normal View History

2024-01-19 17:52:07 +08:00
export default {
mounted() {
if (!this.startHidden) {
$(this.$refs.modal).modal('show');
}
this.$refs.input?.focus();
2024-01-19 17:52:07 +08:00
$(this.$refs.modal).on('hidden.bs.modal', () => {
this.$emit('close');
});
},
beforeUnmount() {
$(this.$refs.modal).modal('hide');
},
methods: {
close() {
this.$emit('close');
$(this.$refs.modal).modal('hide');
},
open() {
this.$emit('open');
$(this.$refs.modal).modal('show');
2024-01-19 17:52:07 +08:00
}
},
}