add some files
This commit is contained in:
parent
3a83348ed4
commit
ca17da363d
15
index.js
15
index.js
@ -1,14 +1,3 @@
|
|||||||
import { defineNuxtModule } from "@nuxt/kit";
|
import MyModule from './modules/module';
|
||||||
|
|
||||||
import { join } from "pathe";
|
export default MyModule;
|
||||||
|
|
||||||
export default defineNuxtModule({
|
|
||||||
hooks: {
|
|
||||||
"components:dirs"(dirs) {
|
|
||||||
dirs.push({
|
|
||||||
path: join(__dirname, "components/Ml/Button"),
|
|
||||||
prefix: 'Ml'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
@ -5,94 +5,85 @@ import {
|
|||||||
addImports,
|
addImports,
|
||||||
} from "@nuxt/kit";
|
} from "@nuxt/kit";
|
||||||
|
|
||||||
import { join } from 'pathe';
|
|
||||||
|
|
||||||
export interface ModuleOptions {}
|
export interface ModuleOptions {}
|
||||||
|
|
||||||
const components = [
|
const components = [
|
||||||
{
|
{
|
||||||
name: "MlButton",
|
name: "MlButton",
|
||||||
path: "./components/Ml/Button/MlButton.vue",
|
path: "../components/Ml/Button/MlButton.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MlPaginator",
|
name: "MlPaginator",
|
||||||
path: "./components/Ml/Paginator/MlPaginator.vue",
|
path: "../components/Ml/Paginator/MlPaginator.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MlDropDown",
|
name: "MlDropDown",
|
||||||
path: "./components/Ml/DropDown/MlDropDown.vue",
|
path: "../components/Ml/DropDown/MlDropDown.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MlDropDownItem",
|
name: "MlDropDownItem",
|
||||||
path: "./components/Ml/DropDown/MlDropDownItem.vue",
|
path: "../components/Ml/DropDown/MlDropDownItem.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MlSlider",
|
name: "MlSlider",
|
||||||
path: "./components/Ml/Slider/MlSlider.vue",
|
path: "../components/Ml/Slider/MlSlider.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MlSliderPoint",
|
name: "MlSliderPoint",
|
||||||
path: "./components/Ml/SliderPoint/MlSliderPoint.vue",
|
path: "../components/Ml/SliderPoint/MlSliderPoint.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MlTabberBase",
|
name: "MlTabberBase",
|
||||||
path: "./components/Ml/Tabber/MlTabberBase.vue",
|
path: "../components/Ml/Tabber/MlTabberBase.vue",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MyComponent",
|
name: "MyComponent",
|
||||||
path: "./components/MyComponent",
|
path: "../components/MyComponent",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const composables = [
|
const composables = [
|
||||||
{
|
{
|
||||||
name: "useRipple",
|
name: "useRipple",
|
||||||
path: "./composables/useRipple.ts",
|
path: "../composables/useRipple.ts",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "useMergeClasses",
|
name: "useMergeClasses",
|
||||||
path: "./composables/useMergeClasses.ts",
|
path: "../composables/useMergeClasses.ts",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "useBounce",
|
name: "useBounce",
|
||||||
path: "./composables/useBounce.ts",
|
path: "../composables/useBounce.ts",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "useTailwindConf",
|
name: "useTailwindConf",
|
||||||
path: "./composables/useTailwindConf.ts",
|
path: "../composables/useTailwindConf.ts",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default defineNuxtModule<ModuleOptions>({
|
export default defineNuxtModule<ModuleOptions>({
|
||||||
// meta: {
|
meta: {
|
||||||
// name: "module",
|
name: "module",
|
||||||
// configKey: "myModule",
|
configKey: "myModule",
|
||||||
// },
|
|
||||||
// defaults: {},
|
|
||||||
// setup(_options, _nuxt) {
|
|
||||||
// const resolver = createResolver(import.meta.url);
|
|
||||||
|
|
||||||
// for (let item of components) {
|
|
||||||
// addComponent({
|
|
||||||
// name: item.name,
|
|
||||||
// filePath: resolver.resolve(item.path),
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for (let item of composables) {
|
|
||||||
// addImports([
|
|
||||||
// {
|
|
||||||
// name: item.name,
|
|
||||||
// from: resolver.resolve(item.path),
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
hooks: {
|
|
||||||
"components:dirs"(dirs) {
|
|
||||||
dirs.push({
|
|
||||||
path: join(__dirname, "components"),
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
defaults: {},
|
||||||
|
setup(_options, _nuxt) {
|
||||||
|
const resolver = createResolver(import.meta.url);
|
||||||
|
|
||||||
|
for (let item of components) {
|
||||||
|
addComponent({
|
||||||
|
name: item.name,
|
||||||
|
filePath: resolver.resolve(item.path),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let item of composables) {
|
||||||
|
addImports([
|
||||||
|
{
|
||||||
|
name: item.name,
|
||||||
|
from: resolver.resolve(item.path),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user