-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
231 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
import Menu from "./src/Menu.vue"; | ||
import MenuItem from "./src/MenuItem.vue"; | ||
import MenuItemGroup from "./src/MenuItemGroup.vue"; | ||
import SubMenu from "./src/SubMenu.vue"; | ||
import type { App } from "vue"; | ||
Menu.name = "menu"; | ||
MenuItem.name = "menu-item"; | ||
MenuItemGroup.name = "menu-item-group"; | ||
SubMenu.name = "sub-menu"; | ||
|
||
Menu.install = (app: App) => { | ||
app.component(Menu.name, Menu); | ||
}; | ||
|
||
export { Menu }; | ||
MenuItem.install = (app: App) => { | ||
app.component(MenuItem.name, MenuItem); | ||
}; | ||
|
||
MenuItemGroup.install = (app: App) => { | ||
app.component(MenuItemGroup.name, MenuItemGroup); | ||
}; | ||
|
||
SubMenu.install = (app: App) => { | ||
app.component(SubMenu.name, SubMenu); | ||
}; | ||
|
||
export { Menu, MenuItem, MenuItemGroup, SubMenu }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/eden-design/packages/eden-ui/components/Menu/src/MenuItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<script setup lang="ts"></script> | ||
|
||
<template> | ||
<div></div> | ||
<div>MenuItem</div> | ||
</template> | ||
|
||
<style scoped lang="scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
lib/eden-design/packages/eden-ui/components/Menu/src/SubMenu.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script setup lang="ts"> | ||
import { | ||
CollapsibleContent, | ||
CollapsibleRoot, | ||
CollapsibleTrigger, | ||
} from "radix-vue"; | ||
import { IMenuData } from "../types/Menu"; | ||
const props = withDefaults(defineProps<IMenuData>(), { | ||
title: "SubMenu", | ||
route: { | ||
path: "/", | ||
}, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<CollapsibleRoot> | ||
<CollapsibleTrigger>{{ props.title }}</CollapsibleTrigger> | ||
</CollapsibleRoot> | ||
</template> | ||
|
||
<style scoped lang="scss"></style> |
28 changes: 19 additions & 9 deletions
28
lib/eden-design/packages/eden-ui/components/Menu/types/Menu.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
export interface IMenuData { | ||
title: string; | ||
route: { | ||
prop: string, | ||
type: 'path' | 'name', | ||
operation: 'push' | 'replace' | ||
}; | ||
children?: IMenuData[]; | ||
} | ||
export interface IMenuDataProps { | ||
route?: | ||
| { | ||
path: string; | ||
operation?: "push" | "replace"; | ||
} | ||
| { | ||
name: string; | ||
operation?: "push" | "replace"; | ||
}; | ||
children?: IMenuData[]; | ||
} | ||
export type IMenuData = | ||
| (IMenuDataProps & { | ||
title: string; | ||
}) | ||
| (IMenuDataProps & { | ||
groupName: string; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.