add some files
This commit is contained in:
parent
accb3a105d
commit
a367b12150
@ -1,6 +0,0 @@
|
||||
<template>
|
||||
<h1>Hello Nuxt3</h1>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
</script>
|
3
index.js
Normal file
3
index.js
Normal file
@ -0,0 +1,3 @@
|
||||
import MyModule from './modules/module';
|
||||
|
||||
export default MyModule;
|
23
modules/module.ts
Normal file
23
modules/module.ts
Normal file
@ -0,0 +1,23 @@
|
||||
// modules/my-module.ts
|
||||
import {
|
||||
defineNuxtModule,
|
||||
createResolver,
|
||||
addComponentsDir,
|
||||
} from "@nuxt/kit";
|
||||
|
||||
export interface ModuleOptions {}
|
||||
|
||||
export default defineNuxtModule<ModuleOptions>({
|
||||
meta: {
|
||||
name: "module",
|
||||
configKey: "myModule",
|
||||
},
|
||||
defaults: {},
|
||||
setup(_options, _nuxt) {
|
||||
const resolver = createResolver(import.meta.url);
|
||||
|
||||
addComponentsDir({
|
||||
path: resolver.resolve("src/components/Ml"),
|
||||
});
|
||||
},
|
||||
});
|
@ -1,6 +1,6 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
modules: ["@nuxtjs/tailwindcss", "@nuxtjs/color-mode"],
|
||||
modules: ["@nuxtjs/tailwindcss", "@nuxtjs/color-mode", "~/modules/module"],
|
||||
compatibilityDate: "2024-04-03",
|
||||
devtools: { enabled: true },
|
||||
colorMode: {},
|
||||
|
@ -1,15 +1,14 @@
|
||||
{
|
||||
"name": "nuxt3-reusable-components",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.7",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"main": "module.ts",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"prepack": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare"
|
||||
"start": "nuxt start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@heroicons/vue": "^2.1.4",
|
||||
|
@ -1,9 +0,0 @@
|
||||
import { defineNuxtModule, addComponentsDir } from '@nuxt/kit'
|
||||
|
||||
export default defineNuxtModule({
|
||||
setup(options, nuxt) {
|
||||
addComponentsDir({
|
||||
path: '~/components/Ml',
|
||||
})
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user