UNPKG

ivue-material-plus

Version:

A high quality UI components Library with Vue.js

40 lines (37 loc) 877 B
import { createApp } from 'vue'; function generateWarning(child, parent) { return () => console.error(`The ${child} component must be used inside a ${parent}`); } function inject(namespace, child, parent) { const defaultImpl = child && parent ? { register: generateWarning(child, parent), unregister: generateWarning(child, parent) } : null; return createApp({ name: "registrable-inject", inject: { [namespace]: { default: defaultImpl } } }); } function provide(namespace) { return createApp({ name: "registrable-provide", methods: { register: null, unregister: null }, provide() { return { [namespace]: { register: this.register, unregister: this.unregister } }; } }); } export { inject, provide }; //# sourceMappingURL=registrable.mjs.map