From 1c2c7aba0908506e794f82d86a404d8b02800a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E5=A3=B0?= Date: Fri, 18 Mar 2022 13:54:42 +0800 Subject: [PATCH] =?UTF-8?q?style(skeleton):=20=E6=89=8B=E5=8A=A8=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20Eslint=20=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devui/skeleton/__tests__/skeleton-item.spec.ts | 3 ++- packages/devui-vue/devui/skeleton/src/item/item.tsx | 7 ++++--- packages/devui-vue/devui/skeleton/src/skeleton.tsx | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/devui-vue/devui/skeleton/__tests__/skeleton-item.spec.ts b/packages/devui-vue/devui/skeleton/__tests__/skeleton-item.spec.ts index b8d52cc6db..4e5db3877c 100644 --- a/packages/devui-vue/devui/skeleton/__tests__/skeleton-item.spec.ts +++ b/packages/devui-vue/devui/skeleton/__tests__/skeleton-item.spec.ts @@ -8,7 +8,8 @@ describe('skeleton-item module', () => { template: ``, }); - expect(wrapper.find('.devui-skeleton__shape__avatar').element.getAttribute('style')).toBe('border-radius: 50%; margin-left: 55px; width: 80px; height: 80px;'); + expect(wrapper.find('.devui-skeleton__shape__avatar').element.getAttribute('style')) + .toBe('border-radius: 50%; margin-left: 55px; width: 80px; height: 80px;'); }); it('render skeleton-item-avatar without animation', () => { diff --git a/packages/devui-vue/devui/skeleton/src/item/item.tsx b/packages/devui-vue/devui/skeleton/src/item/item.tsx index 6f91279ed2..e334d999df 100644 --- a/packages/devui-vue/devui/skeleton/src/item/item.tsx +++ b/packages/devui-vue/devui/skeleton/src/item/item.tsx @@ -56,7 +56,7 @@ export default defineComponent({ } function renderAvatarStyle(avatarShape) { - function renderAvatarShape(avatarShape) { + function renderAvatarShape() { return avatarShape === 'square' ? '' : 'border-radius:50%;'; } @@ -68,7 +68,8 @@ export default defineComponent({ switch (props.shape) { case 'avatar': return <> -
+
; case 'paragraph': return <> @@ -76,7 +77,7 @@ export default defineComponent({ ; default: return <> -
+
; } } diff --git a/packages/devui-vue/devui/skeleton/src/skeleton.tsx b/packages/devui-vue/devui/skeleton/src/skeleton.tsx index c5258d538a..871d95092d 100644 --- a/packages/devui-vue/devui/skeleton/src/skeleton.tsx +++ b/packages/devui-vue/devui/skeleton/src/skeleton.tsx @@ -58,10 +58,10 @@ export default defineComponent({ } function renderAvatarStyle(avatarSize, avatarShape) { - function renderAvatarShape(avatarShape) { + function renderAvatarShape() { return avatarShape === 'square' ? '' : 'border-radius:50%;'; } - function renderAvatarSize(avatarSize) { + function renderAvatarSize() { switch (typeof avatarSize) { case 'string': return `width:${avatarSize};height:${avatarSize};`; @@ -73,7 +73,7 @@ export default defineComponent({ return (renderAvatarSize(avatarSize) + renderAvatarShape(avatarShape)); } function renderTitle(isVisible, titleWidth, isRound) { - function renderTitleWidth(titleWidth) { + function renderTitleWidth() { switch (typeof titleWidth) { case 'string': return `width: ${titleWidth};`; @@ -81,7 +81,7 @@ export default defineComponent({ return `width: ${titleWidth}px;`; } } - function renderTitleVisibility(isVisible) { + function renderTitleVisibility() { return isVisible ? null : 'visibility: hidden;'; }