@inkline/paper
Version:
Paper is a unified interface for defining components for Vue and React using a single code base.
26 lines (21 loc) • 676 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.definePlugin = void 0;
const definePlugin = setup => ({
install(app, options) {
for (const componentIndex in options?.components) {
if (options.components[componentIndex].name) {
app.component(options.components[componentIndex].name, options.components[componentIndex]);
}
}
setup(options, {
provide: (identifier, data) => {
app.config.globalProperties[`$${typeof identifier === "symbol" ? identifier.description : identifier}`] = data;
app.provide(identifier, data);
}
});
}
});
exports.definePlugin = definePlugin;