add some files
This commit is contained in:
parent
232329a05c
commit
00a8fc630e
@ -1,12 +1,14 @@
|
|||||||
// modules/my-module.ts
|
// modules/my-module.ts
|
||||||
import {
|
import { defineNuxtModule, createResolver, addComponent } from "@nuxt/kit";
|
||||||
defineNuxtModule,
|
|
||||||
createResolver,
|
|
||||||
addComponentsDir,
|
|
||||||
} from "@nuxt/kit";
|
|
||||||
|
|
||||||
export interface ModuleOptions {}
|
export interface ModuleOptions {}
|
||||||
|
|
||||||
|
const components = [
|
||||||
|
{
|
||||||
|
name: "MlButton",
|
||||||
|
path: "../src/components/Ml/Button/MlButton.vue",
|
||||||
|
},
|
||||||
|
];
|
||||||
export default defineNuxtModule<ModuleOptions>({
|
export default defineNuxtModule<ModuleOptions>({
|
||||||
meta: {
|
meta: {
|
||||||
name: "module",
|
name: "module",
|
||||||
@ -16,11 +18,11 @@ export default defineNuxtModule<ModuleOptions>({
|
|||||||
setup(_options, _nuxt) {
|
setup(_options, _nuxt) {
|
||||||
const resolver = createResolver(import.meta.url);
|
const resolver = createResolver(import.meta.url);
|
||||||
|
|
||||||
addComponentsDir({
|
for (let item of components) {
|
||||||
path: resolver.resolve("../src/components/Ml"),
|
addComponent({
|
||||||
});
|
name: item.name,
|
||||||
addComponentsDir({
|
filePath: resolver.resolve(item.path),
|
||||||
path: resolver.resolve("../src/composables"),
|
});
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxt3-reusable-components",
|
"name": "nuxt3-reusable-components",
|
||||||
"version": "1.2.4",
|
"version": "1.2.5",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user