This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/mixins/registrable/index.js

41 lines
937 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
import Vue from 'vue';
import { consoleWarn } from '../../util/console';
function generateWarning(child, parent) {
return () => consoleWarn(`The ${child} component must be used inside a ${parent}`);
}
export function inject(namespace, child, parent) {
const defaultImpl = child && parent ? {
register: generateWarning(child, parent),
unregister: generateWarning(child, parent)
} : null;
return Vue.extend({
name: 'registrable-inject',
inject: {
[namespace]: {
default: defaultImpl
}
}
});
}
export function provide(namespace, self = false) {
return Vue.extend({
name: 'registrable-provide',
methods: self ? {} : {
register: null,
unregister: null
},
provide() {
return {
[namespace]: self ? this : {
register: this.register,
unregister: this.unregister
}
};
}
});
}
//# sourceMappingURL=index.js.map