WIP: fix: refs #7408 fix quasarconfig, vncomponents #1238
|
@ -29,7 +29,16 @@ module.exports = configure(function (/* ctx */) {
|
||||||
// app boot file (/src/boot)
|
// app boot file (/src/boot)
|
||||||
// --> boot files are part of "main.js"
|
// --> boot files are part of "main.js"
|
||||||
// https://v2.quasar.dev/quasar-cli/boot-files
|
// https://v2.quasar.dev/quasar-cli/boot-files
|
||||||
boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar', 'quasar.defaults'],
|
boot: [
|
||||||
|
'i18n',
|
||||||
|
'axios',
|
||||||
|
'vnDate',
|
||||||
|
'validations',
|
||||||
|
'quasar',
|
||||||
|
'quasar.defaults',
|
||||||
|
'global-components',
|
||||||
|
],
|
||||||
|
importStrategy: 'auto',
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
||||||
css: ['app.scss'],
|
css: ['app.scss'],
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// src/boot/vn-components.js
|
||||||
|
import { defineAsyncComponent } from 'vue';
|
||||||
|
|
||||||
|
const components = import.meta.glob('src/components/**/*.vue');
|
||||||
|
export default ({ app }) => {
|
||||||
|
for (const path in components) {
|
||||||
|
const componentName = path
|
||||||
|
.split('/')
|
||||||
|
.pop()
|
||||||
|
.replace(/\.\w+$/, '');
|
||||||
|
app.component(componentName, defineAsyncComponent(components[path]));
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue