add some files

This commit is contained in:
Arina Yakovenko 2024-07-08 12:36:47 +02:00
parent 232329a05c
commit 00a8fc630e
2 changed files with 14 additions and 12 deletions

View File

@ -1,12 +1,14 @@
// modules/my-module.ts
import {
defineNuxtModule,
createResolver,
addComponentsDir,
} from "@nuxt/kit";
import { defineNuxtModule, createResolver, addComponent } from "@nuxt/kit";
export interface ModuleOptions {}
const components = [
{
name: "MlButton",
path: "../src/components/Ml/Button/MlButton.vue",
},
];
export default defineNuxtModule<ModuleOptions>({
meta: {
name: "module",
@ -16,11 +18,11 @@ export default defineNuxtModule<ModuleOptions>({
setup(_options, _nuxt) {
const resolver = createResolver(import.meta.url);
addComponentsDir({
path: resolver.resolve("../src/components/Ml"),
});
addComponentsDir({
path: resolver.resolve("../src/composables"),
for (let item of components) {
addComponent({
name: item.name,
filePath: resolver.resolve(item.path),
});
}
},
});

View File

@ -1,6 +1,6 @@
{
"name": "nuxt3-reusable-components",
"version": "1.2.4",
"version": "1.2.5",
"private": false,
"type": "module",
"main": "index.js",