@shopware-ag/meteor-component-library
Version:
The meteor component library is a Vue component library developed by Shopware. It is based on the [Meteor Design System](https://shopware.design/).
17 lines (16 loc) • 566 B
JavaScript
;
const vue = require("vue");
const DialogContext = Symbol("DialogContext");
function useModalContext(component) {
const context = vue.inject(DialogContext, null);
if (context === null) {
const error = new Error(`<${component} /> is missing a parent <mt-modal-root /> component.`);
if (Error.captureStackTrace)
Error.captureStackTrace(error, useModalContext);
throw error;
}
return context;
}
exports.DialogContext = DialogContext;
exports.useModalContext = useModalContext;
//# sourceMappingURL=useModalContext-e62d6d51.js.map