Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

registrable.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  2. import Vue from 'vue';
  3. import { consoleWarn } from '../util/console';
  4. function generateWarning(child, parent) {
  5. return function () {
  6. return consoleWarn('The ' + child + ' component must be used inside a ' + parent);
  7. };
  8. }
  9. export function inject(namespace, child, parent) {
  10. var defaultImpl = child && parent ? {
  11. register: generateWarning(child, parent),
  12. unregister: generateWarning(child, parent)
  13. } : null;
  14. return Vue.extend({
  15. name: 'registrable-inject',
  16. inject: _defineProperty({}, namespace, {
  17. default: defaultImpl
  18. })
  19. });
  20. }
  21. export function provide(namespace) {
  22. return Vue.extend({
  23. name: 'registrable-provide',
  24. methods: {
  25. register: null,
  26. unregister: null
  27. },
  28. provide: function provide() {
  29. return _defineProperty({}, namespace, {
  30. register: this.register,
  31. unregister: this.unregister
  32. });
  33. }
  34. });
  35. }
  36. //# sourceMappingURL=registrable.js.map