From 3015912f1aef0d1813d7934e55f1a638669b7ce5 Mon Sep 17 00:00:00 2001 From: Li Kui <90845831+likui628@users.noreply.github.com> Date: Sun, 11 Aug 2024 16:29:39 +0800 Subject: [PATCH] feat: page component (#4087) * feat: page component * chore: basic page * chore: add demos * chore: add header-sticky support * chore: update web-ele * chore: rename slot name --------- Co-authored-by: Vben --- .../web-ele/src/views/demos/element/index.vue | 12 +++---- .../web-naive/src/views/demos/naive/index.vue | 13 +++---- .../web-naive/src/views/demos/table/index.vue | 9 ++++- packages/effects/common-ui/src/index.ts | 1 + packages/effects/common-ui/src/page/index.ts | 1 + .../common-ui/src/page/page-footer.vue | 13 +++++++ .../common-ui/src/page/page-header.vue | 20 +++++++++++ packages/effects/common-ui/src/page/page.ts | 11 ++++++ packages/effects/common-ui/src/page/page.vue | 34 +++++++++++++++++++ 9 files changed, 98 insertions(+), 16 deletions(-) create mode 100644 packages/effects/common-ui/src/page/index.ts create mode 100644 packages/effects/common-ui/src/page/page-footer.vue create mode 100644 packages/effects/common-ui/src/page/page-header.vue create mode 100644 packages/effects/common-ui/src/page/page.ts create mode 100644 packages/effects/common-ui/src/page/page.vue diff --git a/apps/web-ele/src/views/demos/element/index.vue b/apps/web-ele/src/views/demos/element/index.vue index 15f0d5e3..5ca94b73 100644 --- a/apps/web-ele/src/views/demos/element/index.vue +++ b/apps/web-ele/src/views/demos/element/index.vue @@ -1,4 +1,6 @@ diff --git a/apps/web-naive/src/views/demos/naive/index.vue b/apps/web-naive/src/views/demos/naive/index.vue index e328f413..d115ff24 100644 --- a/apps/web-naive/src/views/demos/naive/index.vue +++ b/apps/web-naive/src/views/demos/naive/index.vue @@ -1,6 +1,7 @@ diff --git a/apps/web-naive/src/views/demos/table/index.vue b/apps/web-naive/src/views/demos/table/index.vue index 02acf580..ae669052 100644 --- a/apps/web-naive/src/views/demos/table/index.vue +++ b/apps/web-naive/src/views/demos/table/index.vue @@ -1,6 +1,8 @@ diff --git a/packages/effects/common-ui/src/index.ts b/packages/effects/common-ui/src/index.ts index 8da49eaf..1c352371 100644 --- a/packages/effects/common-ui/src/index.ts +++ b/packages/effects/common-ui/src/index.ts @@ -3,4 +3,5 @@ export * from './authentication'; export * from './dashboard'; export * from './ellipsis-text'; export * from './fallback'; +export * from './page'; export { useToast } from '@vben-core/shadcn-ui'; diff --git a/packages/effects/common-ui/src/page/index.ts b/packages/effects/common-ui/src/page/index.ts new file mode 100644 index 00000000..65bf3c69 --- /dev/null +++ b/packages/effects/common-ui/src/page/index.ts @@ -0,0 +1 @@ +export { default as Page } from './page.vue'; diff --git a/packages/effects/common-ui/src/page/page-footer.vue b/packages/effects/common-ui/src/page/page-footer.vue new file mode 100644 index 00000000..d86d1062 --- /dev/null +++ b/packages/effects/common-ui/src/page/page-footer.vue @@ -0,0 +1,13 @@ + + + diff --git a/packages/effects/common-ui/src/page/page-header.vue b/packages/effects/common-ui/src/page/page-header.vue new file mode 100644 index 00000000..4249017f --- /dev/null +++ b/packages/effects/common-ui/src/page/page-header.vue @@ -0,0 +1,20 @@ + + + diff --git a/packages/effects/common-ui/src/page/page.ts b/packages/effects/common-ui/src/page/page.ts new file mode 100644 index 00000000..3d504b42 --- /dev/null +++ b/packages/effects/common-ui/src/page/page.ts @@ -0,0 +1,11 @@ +interface PageHeaderProps { + title?: string; +} + +interface Props extends PageHeaderProps { + headerSticky?: boolean; + showFooter?: boolean; + showHeader?: boolean; +} + +export type { PageHeaderProps, Props }; diff --git a/packages/effects/common-ui/src/page/page.vue b/packages/effects/common-ui/src/page/page.vue new file mode 100644 index 00000000..41fbdd74 --- /dev/null +++ b/packages/effects/common-ui/src/page/page.vue @@ -0,0 +1,34 @@ + + +