mirror of
https://github.com/bitinflow/ui.git
synced 2026-03-14 06:06:01 +00:00
chore(release): v0.0.3
This commit is contained in:
@@ -4,8 +4,7 @@ import {
|
||||
createResolver,
|
||||
useLogger,
|
||||
addImportsDir,
|
||||
addComponent,
|
||||
resolveFiles, addComponentsDir
|
||||
addComponentsDir
|
||||
} from '@nuxt/kit'
|
||||
|
||||
// Module options TypeScript inteface definition
|
||||
@@ -38,6 +37,6 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
console.log(r)
|
||||
});
|
||||
|
||||
logger.success('Session setup complete')
|
||||
logger.success('@bitinflow/ui module loaded')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import {useMenuStore} from "../stores/menu.js";
|
||||
|
||||
export const useMenu = (data) => {
|
||||
const menu = useMenuStore()
|
||||
if (data.thirdLevelLinks) {
|
||||
menu.updateThirdLevelLinks(data.thirdLevelLinks)
|
||||
}
|
||||
}
|
||||
9
src/runtime/composables/index.ts
Normal file
9
src/runtime/composables/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import {useMenuStore} from "../stores/menu";
|
||||
import {MenuOptions} from "../../types";
|
||||
|
||||
export const useMenu = (options: MenuOptions) => {
|
||||
const menu = useMenuStore()
|
||||
if (options.thirdLevelLinks) {
|
||||
menu.updateThirdLevelLinks(options.thirdLevelLinks)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
import {defineStore} from 'pinia';
|
||||
import {ThirdLevelLink} from "../../types";
|
||||
|
||||
export const useMenuStore = defineStore('menu', {
|
||||
state: () => {
|
||||
return {
|
||||
thirdLevelLinks: []
|
||||
thirdLevelLinks: [] as Array<ThirdLevelLink>
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
updateThirdLevelLinks(links) {
|
||||
updateThirdLevelLinks(links: Array<ThirdLevelLink>) {
|
||||
this.thirdLevelLinks = links;
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
9
src/types.ts
Normal file
9
src/types.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface MenuOptions {
|
||||
thirdLevelLinks: Array<ThirdLevelLink>;
|
||||
}
|
||||
|
||||
export interface ThirdLevelLink {
|
||||
name: string;
|
||||
icon: string;
|
||||
to: string;
|
||||
}
|
||||
Reference in New Issue
Block a user