UNPKG

yyzone

Version:

yyzone vue components and utils

26 lines (21 loc) 508 B
import Modal from './modal.js' let ModalInstance function getModalInstance(options) { ModalInstance = ModalInstance || Modal.newInstance(options) return ModalInstance } Modal.show = (options) => { options.onRemove = function () { ModalInstance = null } const instance = getModalInstance(options) instance.show() } Modal.hide = () => { if (!ModalInstance) { return false } const instance = getModalInstance() instance.hide() } export default Modal