From f96d6b221c7ad97e0ed80250acb192b6be92c4a6 Mon Sep 17 00:00:00 2001 From: vben Date: Tue, 20 Oct 2020 23:11:58 +0800 Subject: [PATCH] perf: code style --- src/components/Icon/index.tsx | 3 +-- src/components/Loading/BasicLoading.vue | 2 -- src/components/Loading/FullLoading.vue | 2 +- src/components/Markdown/src/index.vue | 1 - src/components/Menu/src/BasicMenu.tsx | 2 +- src/layouts/default/index.less | 5 +++++ 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index 0a9a98d5..500c4a09 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -53,8 +53,6 @@ export default defineComponent({ } }; - watch(() => props.icon, update, { flush: 'post' }); - const wrapStyleRef = computed((): any => { const { size, color } = props; let fs = size; @@ -68,6 +66,7 @@ export default defineComponent({ }; }); + watch(() => props.icon, update, { flush: 'post' }); onMounted(update); return () => ( diff --git a/src/components/Loading/BasicLoading.vue b/src/components/Loading/BasicLoading.vue index 1015257d..f0afa908 100644 --- a/src/components/Loading/BasicLoading.vue +++ b/src/components/Loading/BasicLoading.vue @@ -15,8 +15,6 @@ // components import { defineComponent, computed } from 'vue'; - // hook - import { SizeEnum, sizeMap } from '/@/enums/sizeEnum'; import { BasicLoadingProps } from './type'; diff --git a/src/components/Loading/FullLoading.vue b/src/components/Loading/FullLoading.vue index a2b436f9..4b0dcc87 100644 --- a/src/components/Loading/FullLoading.vue +++ b/src/components/Loading/FullLoading.vue @@ -21,7 +21,6 @@ absolute: Boolean as PropType, }, setup(props) { - // 样式前缀 const getStyle = computed((): any => { return props.absolute ? { @@ -32,6 +31,7 @@ } : {}; }); + return { getStyle, SizeEnum }; }, }); diff --git a/src/components/Markdown/src/index.vue b/src/components/Markdown/src/index.vue index b9023444..86142a2f 100644 --- a/src/components/Markdown/src/index.vue +++ b/src/components/Markdown/src/index.vue @@ -29,7 +29,6 @@ setup(props, { attrs, emit }) { const wrapRef = ref>(null); const vditorRef = ref>(null); - const initedRef = ref(false); function init() { diff --git a/src/components/Menu/src/BasicMenu.tsx b/src/components/Menu/src/BasicMenu.tsx index 538bbb56..650b9bec 100644 --- a/src/components/Menu/src/BasicMenu.tsx +++ b/src/components/Menu/src/BasicMenu.tsx @@ -66,7 +66,7 @@ export default defineComponent({ offset += 54; } return { - height: `calc(100% - ${offset}px)`, + height: `calc(100% - ${offset - 30}px)`, position: 'relative', overflow: 'auto', }; diff --git a/src/layouts/default/index.less b/src/layouts/default/index.less index e293c79b..c1bdfeac 100644 --- a/src/layouts/default/index.less +++ b/src/layouts/default/index.less @@ -417,3 +417,8 @@ padding: 0 16px; flex-grow: 1; } + +.ant-layout-sider-trigger { + height: 30px; + line-height: 30px; +} -- GitLab