importGlobalComponents.js 390 B

12345678910111213141516
  1. import { boot } from "quasar/wrappers";
  2. const components = import.meta.glob("src/components/global/**/*.vue", {
  3. eager: true,
  4. });
  5. export default boot(async ({ app }) => {
  6. for (const path in components) {
  7. const mod = components[path];
  8. const componentName = path
  9. .split("/")
  10. .pop()
  11. .replace(/\.\w+$/, "");
  12. app.component(componentName, mod.default);
  13. }
  14. });