From d630710c835b7719b84edaeaa86771be0dde03ac Mon Sep 17 00:00:00 2001 From: huanghong Date: Thu, 31 Mar 2022 00:33:19 +0800 Subject: [PATCH 1/6] feat: add component sticky --- mock/role/index.ts | 9 ++ src/components/ContentDetailWrap/index.ts | 3 + .../src/ContentDetailWrap.vue | 76 ++++++++++ .../ContentWrap/src/ContentWrap.vue | 32 +++-- src/components/Sticky/index.ts | 3 + src/components/Sticky/src/Sticky.vue | 134 ++++++++++++++++++ src/layout/components/AppView.vue | 2 +- src/locales/en.ts | 9 +- src/locales/zh-CN.ts | 7 +- src/router/index.ts | 8 ++ src/views/Components/Sticky.vue | 62 ++++++++ src/views/Example/Page/ExampleAdd.vue | 11 +- src/views/Example/Page/ExampleDetail.vue | 11 +- src/views/Example/Page/ExampleEdit.vue | 11 +- 14 files changed, 339 insertions(+), 39 deletions(-) create mode 100644 src/components/ContentDetailWrap/index.ts create mode 100644 src/components/ContentDetailWrap/src/ContentDetailWrap.vue create mode 100644 src/components/Sticky/index.ts create mode 100644 src/components/Sticky/src/Sticky.vue create mode 100644 src/views/Components/Sticky.vue diff --git a/mock/role/index.ts b/mock/role/index.ts index 4079507..3306fc4 100644 --- a/mock/role/index.ts +++ b/mock/role/index.ts @@ -257,6 +257,14 @@ const adminList = [ meta: { title: 'router.inputPassword' } + }, + { + path: 'sticky', + component: 'views/Components/Sticky', + name: 'Sticky', + meta: { + title: 'router.sticky' + } } ] }, @@ -477,6 +485,7 @@ const testList: string[] = [ '/components/highlight', '/components/infotip', '/Components/InputPassword', + '/Components/Sticky', '/hooks', '/hooks/useWatermark', '/level', diff --git a/src/components/ContentDetailWrap/index.ts b/src/components/ContentDetailWrap/index.ts new file mode 100644 index 0000000..1871cac --- /dev/null +++ b/src/components/ContentDetailWrap/index.ts @@ -0,0 +1,3 @@ +import ContentDetailWrap from './src/ContentDetailWrap.vue' + +export { ContentDetailWrap } diff --git a/src/components/ContentDetailWrap/src/ContentDetailWrap.vue b/src/components/ContentDetailWrap/src/ContentDetailWrap.vue new file mode 100644 index 0000000..e60acd4 --- /dev/null +++ b/src/components/ContentDetailWrap/src/ContentDetailWrap.vue @@ -0,0 +1,76 @@ + + + + diff --git a/src/components/ContentWrap/src/ContentWrap.vue b/src/components/ContentWrap/src/ContentWrap.vue index 705b6bb..bc848d5 100644 --- a/src/components/ContentWrap/src/ContentWrap.vue +++ b/src/components/ContentWrap/src/ContentWrap.vue @@ -14,20 +14,22 @@ defineProps({ diff --git a/src/components/Sticky/index.ts b/src/components/Sticky/index.ts new file mode 100644 index 0000000..5e1de45 --- /dev/null +++ b/src/components/Sticky/index.ts @@ -0,0 +1,3 @@ +import Sticky from './src/Sticky.vue' + +export { Sticky } diff --git a/src/components/Sticky/src/Sticky.vue b/src/components/Sticky/src/Sticky.vue new file mode 100644 index 0000000..82f9976 --- /dev/null +++ b/src/components/Sticky/src/Sticky.vue @@ -0,0 +1,134 @@ + + diff --git a/src/layout/components/AppView.vue b/src/layout/components/AppView.vue index 1cc009a..16c681d 100644 --- a/src/layout/components/AppView.vue +++ b/src/layout/components/AppView.vue @@ -22,7 +22,7 @@ const getCaches = computed((): string[] => {