From 66c5b5d90c8016569a562c019cee8af6489691d9 Mon Sep 17 00:00:00 2001
From: flippedround <734243792@qq.com>
Date: Fri, 3 Feb 2023 11:22:30 +0800
Subject: [PATCH] feat(Menu): init menu
---
components.d.ts | 5 +
src/components/Navigation/Menu/menu.story.md | 17 ++
src/components/Navigation/Menu/menu.story.vue | 288 ++++++++++++++++++
3 files changed, 310 insertions(+)
create mode 100644 src/components/Navigation/Menu/menu.story.md
create mode 100644 src/components/Navigation/Menu/menu.story.vue
diff --git a/components.d.ts b/components.d.ts
index 6dedeb5..60e2687 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -74,6 +74,9 @@ declare module '@vue/runtime-core' {
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
+ ElMenu: typeof import('element-plus/es')['ElMenu']
+ ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
+ ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
ElOption: typeof import('element-plus/es')['ElOption']
ElOptionGroup: typeof import('element-plus/es')['ElOptionGroup']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
@@ -94,6 +97,7 @@ declare module '@vue/runtime-core' {
ElSpace: typeof import('element-plus/es')['ElSpace']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
+ ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTag: typeof import('element-plus/es')['ElTag']
@@ -116,6 +120,7 @@ declare module '@vue/runtime-core' {
'Link.story': typeof import('./src/components/Basic/Link/link.story.vue')['default']
'Loading.story': typeof import('./src/components/Feedback/Loading/loading.story.vue')['default']
MainColor: typeof import('./src/components/Basic/Color/main-color.vue')['default']
+ 'Menu.story': typeof import('./src/components/Navigation/Menu/menu.story.vue')['default']
'Message.story': typeof import('./src/components/Feedback/Message/message.story.vue')['default']
NeutralColor: typeof import('./src/components/Basic/Color/neutral-color.vue')['default']
'Notification.story': typeof import('./src/components/Feedback/Notification/notification.story.vue')['default']
diff --git a/src/components/Navigation/Menu/menu.story.md b/src/components/Navigation/Menu/menu.story.md
new file mode 100644
index 0000000..f5b25a7
--- /dev/null
+++ b/src/components/Navigation/Menu/menu.story.md
@@ -0,0 +1,17 @@
+## Menu Attributes
+
+| Name | Description | Type | Accepted Values | Default |
+| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------------------- | -------- |
+| mode | menu display mode | string | horizontal / vertical | vertical |
+| collapse | whether the menu is collapsed (available only in vertical mode) | boolean | — | false |
+| ellipsis | whether the menu is ellipsis (available only in horizontal mode) | boolean | — | true |
+| background-color | background color of Menu (hex format) (deprecated, use `--bg-color` instead) | string | — | #ffffff |
+| text-color | text color of Menu (hex format) (deprecated, use `--text-color` instead) | string | — | #303133 |
+| active-text-color | text color of currently active menu item (hex format) (deprecated, use `--active-color` instead) | string | — | #409EFF |
+| default-active | index of active menu on page load | string | — | — |
+| default-openeds | array that contains indexes of currently active sub-menus | Array | — | — |
+| unique-opened | whether only one sub-menu can be active | boolean | — | false |
+| menu-trigger | how sub-menus are triggered, only works when `mode` is 'horizontal' | string | hover / click | hover |
+| router | whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load. | boolean | — | false |
+| collapse-transition | whether to enable the collapse transition | boolean | — | true |
+| popper-effect | Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed | string | dark / light | dark |
diff --git a/src/components/Navigation/Menu/menu.story.vue b/src/components/Navigation/Menu/menu.story.vue
new file mode 100644
index 0000000..6920f00
--- /dev/null
+++ b/src/components/Navigation/Menu/menu.story.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+ Navigator One
+
+
+
+
+ Workspace
+
+
+ item one
+
+
+ item two
+
+
+ item three
+
+
+
+ item four
+
+
+ item one
+
+
+ item two
+
+
+ item three
+
+
+
+
+ Info
+
+
+ Orders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+