Skip to content

Commit

Permalink
测试
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9804 committed Jan 1, 2024
1 parent 44541c2 commit 742d888
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 38 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/deploy-eden-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,13 @@ jobs:
REMOTE_USER: ${{ secrets.SERVER_USER_PRODUCTION }}
TARGET: "/var/www/eden-docs"
EXCLUDE: ".git*"
- name: Demo rsync deploy
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_PASS_PRODUCTION }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "./lib/eden-design/dist/"
REMOTE_HOST: ${{ secrets.SERVER_HOST_PRODUCTION }}
REMOTE_USER: ${{ secrets.SERVER_USER_PRODUCTION }}
TARGET: "/var/www/eden-docs/demo"
EXCLUDE: ".git*"
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": ["lintstagedrc", "unocss"]
}
90 changes: 77 additions & 13 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/eden-design/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ hero:
text: 设计规范
link: /guideline/design/
- theme: alt
text: 设计语言
link: /guideline/design/design-language
text: Demo
link: https://eden.blue-archive.io/demo/index.html
# image:
# src: /cover.png
# alt: eden-cover
Expand Down
6 changes: 5 additions & 1 deletion lib/eden-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"@vue/eslint-config-typescript": "^11.0.3",
"prettier": "^2.8.8",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-sort-exports": "^0.8.0"
"eslint-plugin-sort-exports": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-vue": "^9.15.1"
}
}
20 changes: 19 additions & 1 deletion lib/eden-design/packages/eden-ui/components/Menu/index.ts
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 };
28 changes: 23 additions & 5 deletions lib/eden-design/packages/eden-ui/components/Menu/src/Menu.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<script setup lang="ts">
<script setup lang="tsx">
import { IMenuData } from "../types/Menu";
import SubMenu from "./SubMenu.vue";
import MenuItem from "./MenuItem.vue";
const props = defineProps<{
title?: string;
data?: IMenuData[];
}>();
const menuItemTriage = [
{
keyIs: "groupName",
component: SubMenu,
},
{
keyIs: "title",
component: MenuItem,
},
];
</script>

<template>
Expand All @@ -15,10 +28,15 @@ const props = defineProps<{
<div class="eden-ui__menu__header--title">
<slot name="title"></slot>
</div>
<div class="eden--ui__menu__header--content" v-if="!props.data">
<slot></slot>
</div>
<div class="eden--ui__menu__header--content" v-else></div>
</div>
<div class="eden--ui__menu__content" v-if="!props.data">
<slot></slot>
</div>
<div class="eden--ui__menu__content" v-else>
<component
v-for="item in props.data"
:is="menuItemTriage.find(triage => item[triage.keyIs])?.component"
/>
</div>
</div>
</template>
Expand Down
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>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {

<template>
<CollapsibleRoot>
<CollapsibleTrigger>111</CollapsibleTrigger>
<CollapsibleTrigger>MenuItemGroup</CollapsibleTrigger>
</CollapsibleRoot>
</template>

Expand Down
22 changes: 22 additions & 0 deletions lib/eden-design/packages/eden-ui/components/Menu/src/SubMenu.vue
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 lib/eden-design/packages/eden-ui/components/Menu/types/Menu.ts
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;
});
9 changes: 7 additions & 2 deletions lib/eden-design/packages/eden-ui/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import type { App } from "vue";
import "./styles.scss";
import { Menu } from "./components/Menu/index";
import { Menu, MenuItem, MenuItemGroup, SubMenu } from "./components/Menu";

const components = [Menu];
const components = [
Menu,
MenuItem,
MenuItemGroup,
SubMenu,
];
const componentPrefix = "e";

const install = (app: App) => {
Expand Down
Loading

0 comments on commit 742d888

Please sign in to comment.