From b4c9ba941110b1358bd16dd128208243588317ab Mon Sep 17 00:00:00 2001 From: Yanbowen <349952469@qq.com> Date: Fri, 31 Dec 2021 16:51:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(projects):=20=E5=85=A8=E5=B1=80=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/header/components/index.ts | 3 + .../search/components/SearchFooter.vue | 31 ++++ .../search/components/SearchResult.vue | 58 +++++++ src/layout/header/components/search/index.vue | 150 ++++++++++++++++++ src/layout/header/index.vue | 6 + 5 files changed, 248 insertions(+) create mode 100644 src/layout/header/components/index.ts create mode 100644 src/layout/header/components/search/components/SearchFooter.vue create mode 100644 src/layout/header/components/search/components/SearchResult.vue create mode 100644 src/layout/header/components/search/index.vue diff --git a/src/layout/header/components/index.ts b/src/layout/header/components/index.ts new file mode 100644 index 000000000..e9cc94f79 --- /dev/null +++ b/src/layout/header/components/index.ts @@ -0,0 +1,3 @@ +import SearchModal from './search/index.vue'; + +export { SearchModal }; diff --git a/src/layout/header/components/search/components/SearchFooter.vue b/src/layout/header/components/search/components/SearchFooter.vue new file mode 100644 index 000000000..27a2727ea --- /dev/null +++ b/src/layout/header/components/search/components/SearchFooter.vue @@ -0,0 +1,31 @@ + + + + diff --git a/src/layout/header/components/search/components/SearchResult.vue b/src/layout/header/components/search/components/SearchResult.vue new file mode 100644 index 000000000..722a6d059 --- /dev/null +++ b/src/layout/header/components/search/components/SearchResult.vue @@ -0,0 +1,58 @@ + + + + diff --git a/src/layout/header/components/search/index.vue b/src/layout/header/components/search/index.vue new file mode 100644 index 000000000..639258e2e --- /dev/null +++ b/src/layout/header/components/search/index.vue @@ -0,0 +1,150 @@ + + + + diff --git a/src/layout/header/index.vue b/src/layout/header/index.vue index bf45073cb..6f6e3eac0 100644 --- a/src/layout/header/index.vue +++ b/src/layout/header/index.vue @@ -51,6 +51,7 @@ + @@ -79,6 +80,7 @@ GithubOutlined, LockOutlined, } from '@ant-design/icons-vue'; + import { SearchModal } from './components'; import { useUserStore } from '@/store/modules/user'; import { useLockscreenStore } from '@/store/modules/lockscreen'; @@ -96,6 +98,7 @@ const router = useRouter(); const route = useRoute(); const userInfo = computed(() => userStore.userInfo); + const searchVisible = ref(false); const menus = computed(() => { console.log('route', route, userStore.menus); if (route.meta?.namePath) { @@ -204,6 +207,9 @@ { icon: SearchOutlined, tips: '搜索', + eventObject: { + click: () => (searchVisible.value = true), + }, }, { icon: GithubOutlined,