From bb3beda7b74c433e55dfd228188cfdc3b43fb592 Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Wed, 1 Dec 2021 11:43:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8F=82=E6=95=B0,=20=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devui-vue/devui/status/__tests__/status.spec.ts | 10 ++++++++-- packages/devui-vue/devui/status/src/status.tsx | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/devui-vue/devui/status/__tests__/status.spec.ts b/packages/devui-vue/devui/status/__tests__/status.spec.ts index 5bd4546d..088bc594 100644 --- a/packages/devui-vue/devui/status/__tests__/status.spec.ts +++ b/packages/devui-vue/devui/status/__tests__/status.spec.ts @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import Status from '../status'; +import Status from '../src/status'; describe('d-status', () => { it('type', async () => { @@ -9,8 +9,12 @@ describe('d-status', () => { expect(wrapper.classes()).toContain('devui-status-bg-success'); - await wrapper.setProps({ type: 'error' }); + await wrapper.setProps({type: ''}); + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + await wrapper.setProps({ type: 'error' }); + expect(wrapper.classes()).toContain('devui-status-bg-error'); await wrapper.setProps({ type: 'warning' }); @@ -32,6 +36,8 @@ describe('d-status', () => { await wrapper.setProps({type: 'invalid'}); expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + }); it('slot', () => { diff --git a/packages/devui-vue/devui/status/src/status.tsx b/packages/devui-vue/devui/status/src/status.tsx index 40e8645c..45dead7f 100644 --- a/packages/devui-vue/devui/status/src/status.tsx +++ b/packages/devui-vue/devui/status/src/status.tsx @@ -7,7 +7,7 @@ export default defineComponent({ name: 'DStatus', props: { type:{ - default: 'initial', + default: 'invalid', type: String as () => IStatusType } }, -- Gitee From e9096bbeb600d1c8688e65fae9bad531383edb95 Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Wed, 1 Dec 2021 11:44:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8F=82=E6=95=B0,=20=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/devui-vue/docs/components/status/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devui-vue/docs/components/status/index.md b/packages/devui-vue/docs/components/status/index.md index fc143388..817cf08b 100644 --- a/packages/devui-vue/docs/components/status/index.md +++ b/packages/devui-vue/docs/components/status/index.md @@ -27,4 +27,4 @@ | 参数 | 类型 | 默认 | 说明 | | :--: | :------------------------------------------------------------: | :-------: | :--------------------------------------------------------------------------: | -| type | `success\|error\|warning\|initial\|waiting\|running\| invalid` | 'initial' | 必选,类型,值有 success、error、warning、initial、waiting、running、invalid | +| type | `success\|error\|warning\|initial\|waiting\|running\| invalid` | 'invalid' | 必选,类型,值有 success、error、warning、initial、waiting、running、invalid | -- Gitee