From ed753ac97da2a32bc456d15728c27992365bc087 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 9 Oct 2020 19:41:03 +0800 Subject: [PATCH] types: use CSSProperties for style --- src/button/index.tsx | 6 +++--- src/image/index.tsx | 4 ++-- src/tabs/TabsTitle.tsx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/button/index.tsx b/src/button/index.tsx index 8034f452f..f0663ba83 100644 --- a/src/button/index.tsx +++ b/src/button/index.tsx @@ -1,4 +1,4 @@ -import { PropType } from 'vue'; +import { PropType, CSSProperties } from 'vue'; // Utils import { createNamespace } from '../utils'; @@ -114,7 +114,7 @@ export default createComponent({ const getStyle = () => { const { color, plain } = props; if (color) { - const style: Record = {}; + const style: CSSProperties = {}; style.color = plain ? color : WHITE; @@ -125,7 +125,7 @@ export default createComponent({ // hide border when color is linear-gradient if (color.indexOf('gradient') !== -1) { - style.border = '0'; + style.border = 0; } else { style.borderColor = color; } diff --git a/src/image/index.tsx b/src/image/index.tsx index 416a036e0..84dacd340 100644 --- a/src/image/index.tsx +++ b/src/image/index.tsx @@ -1,4 +1,4 @@ -import { ref, watch, computed, PropType } from 'vue'; +import { ref, watch, computed, PropType, CSSProperties } from 'vue'; import { createNamespace, isDef, addUnit } from '../utils'; import Icon from '../icon'; @@ -42,7 +42,7 @@ export default createComponent({ const imageRef = ref(); const style = computed(() => { - const style: Record = {}; + const style: CSSProperties = {}; if (isDef(props.width)) { style.width = addUnit(props.width); diff --git a/src/tabs/TabsTitle.tsx b/src/tabs/TabsTitle.tsx index 2ac2a2f30..fd5273445 100644 --- a/src/tabs/TabsTitle.tsx +++ b/src/tabs/TabsTitle.tsx @@ -1,4 +1,4 @@ -import { computed } from 'vue'; +import { computed, CSSProperties } from 'vue'; import { createNamespace, isDef } from '../utils'; import Badge from '../badge'; @@ -21,7 +21,7 @@ export default createComponent({ setup(props) { const style = computed(() => { - const style: Record = {}; + const style: CSSProperties = {}; const { type, color,