From e79e540b48be80fb08b67a99e64bede3816b2c9e Mon Sep 17 00:00:00 2001 From: vben Date: Tue, 3 Nov 2020 21:00:14 +0800 Subject: [PATCH] perf(logo): optimize logo code --- package.json | 2 +- src/components/Breadcrumb/Breadcrumb.vue | 2 +- src/components/Menu/src/SearchInput.vue | 15 ++++---- src/layouts/Logo.vue | 11 +++--- src/layouts/default/LayoutMenu.tsx | 16 +++++--- src/layouts/default/index.less | 2 +- src/settings/projectSetting.ts | 2 + src/types/config.d.ts | 1 + src/views/sys/login/Login.vue | 4 +- yarn.lock | 47 ++++++++++++------------ 10 files changed, 56 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 60dbcbb4..f5085fb7 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "bootstrap": "yarn install", "serve": "esno ./build/script/preserve.ts && cross-env NODE_ENV=development vite", - "build": " rimraf dist && cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts", + "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts", "build:site": "cross-env SITE=true npm run build ", "build:no-cache": "yarn clean:cache && npm run build", "typecheck": "typecheck .", diff --git a/src/components/Breadcrumb/Breadcrumb.vue b/src/components/Breadcrumb/Breadcrumb.vue index 42e4ab95..d1f30612 100644 --- a/src/components/Breadcrumb/Breadcrumb.vue +++ b/src/components/Breadcrumb/Breadcrumb.vue @@ -73,7 +73,7 @@ &.is-link, a { - font-weight: 700; + font-weight: 500; color: @text-color-base; text-decoration: none; transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); diff --git a/src/components/Menu/src/SearchInput.vue b/src/components/Menu/src/SearchInput.vue index 5aeccfdc..7e60bc01 100644 --- a/src/components/Menu/src/SearchInput.vue +++ b/src/components/Menu/src/SearchInput.vue @@ -48,7 +48,7 @@ const searchClass = computed(() => { const cls: string[] = []; cls.push(props.theme ? `menu-search-input__search--${props.theme}` : ''); - // cls.push(props.collapsed ? 'hide-search-icon' : ''); + cls.push(props.collapsed ? 'hide-search-icon' : ''); return cls; }); @@ -66,12 +66,13 @@ .menu-search-input { margin: 12px 8px; - // &.hide-search-icon { - // .ant-input, - // .ant-input-suffix { - // opacity: 0; - // } - // } + &.hide-search-icon { + .ant-input, + .ant-input-suffix { + opacity: 0; + transition: all 0.5s; + } + } &__search--dark { .ant-input-affix-wrapper, diff --git a/src/layouts/Logo.vue b/src/layouts/Logo.vue index c0776827..7c4b8709 100644 --- a/src/layouts/Logo.vue +++ b/src/layouts/Logo.vue @@ -1,5 +1,5 @@