版博士V2.0程序
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.
 
 
 
 

49 lines
1.1 KiB

  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var shared = require('@vue/shared');
  4. const withInstall = (main, extra) => {
  5. ;
  6. main.install = (app) => {
  7. for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
  8. app.component(comp.name, comp);
  9. }
  10. };
  11. if (extra) {
  12. for (const [key, comp] of Object.entries(extra)) {
  13. ;
  14. main[key] = comp;
  15. }
  16. }
  17. return main;
  18. };
  19. const withInstallFunction = (fn, name) => {
  20. ;
  21. fn.install = (app) => {
  22. ;
  23. fn._context = app._context;
  24. app.config.globalProperties[name] = fn;
  25. };
  26. return fn;
  27. };
  28. const withInstallDirective = (directive, name) => {
  29. ;
  30. directive.install = (app) => {
  31. app.directive(name, directive);
  32. };
  33. return directive;
  34. };
  35. const withNoopInstall = (component) => {
  36. ;
  37. component.install = shared.NOOP;
  38. return component;
  39. };
  40. exports.withInstall = withInstall;
  41. exports.withInstallDirective = withInstallDirective;
  42. exports.withInstallFunction = withInstallFunction;
  43. exports.withNoopInstall = withNoopInstall;
  44. //# sourceMappingURL=install.js.map