From f66eab93fdad1cd083c51afbdf7b9826d7703b05 Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Sat, 4 Dec 2021 01:31:44 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/devui-vue/devui/status/__tests__/status.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/devui-vue/devui/status/__tests__/status.spec.ts b/packages/devui-vue/devui/status/__tests__/status.spec.ts index 088bc594..28f18878 100644 --- a/packages/devui-vue/devui/status/__tests__/status.spec.ts +++ b/packages/devui-vue/devui/status/__tests__/status.spec.ts @@ -11,6 +11,14 @@ describe('d-status', () => { await wrapper.setProps({type: ''}); + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + await wrapper.setProps({type: null}); + + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + await wrapper.setProps({type: undefined}); + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); await wrapper.setProps({ type: 'error' }); -- Gitee From d6c86e644af5e52d6392a05f14232ecae8847715 Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Sun, 5 Dec 2021 22:49:48 +0800 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Ecomponents?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/components/comment/index.md | 48 +++++++++++++++++++ .../docs/en-US/components/comment/index.md | 48 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 packages/devui-vue/docs/components/comment/index.md create mode 100644 packages/devui-vue/docs/en-US/components/comment/index.md diff --git a/packages/devui-vue/docs/components/comment/index.md b/packages/devui-vue/docs/components/comment/index.md new file mode 100644 index 00000000..4d9cca29 --- /dev/null +++ b/packages/devui-vue/docs/components/comment/index.md @@ -0,0 +1,48 @@ +# Comment 评论 + +对网站内容的反馈、评价和讨论。 + +### 何时使用 + +评论组件可用于对事物的讨论,例如页面、博客文章、问题等等。 + +### 基本评论 + +:::demo + +```vue + +``` + +::: + + + +### API + +d-comment 参数 +| 参数 | 类型 | 默认 | 说明 | +| :------: | :--: | :--: | :---------------------------------------------- | +| actions | - | - | - | +| author | - | - | 要显示为注释作者的元素 | +| avatar | - | - | 要显示为评论头像的元素 - 通常是 avatar | +| content | - | - | 评论的主要内容 | +| datetime | - | - | 展示时间描述 | diff --git a/packages/devui-vue/docs/en-US/components/comment/index.md b/packages/devui-vue/docs/en-US/components/comment/index.md new file mode 100644 index 00000000..88678498 --- /dev/null +++ b/packages/devui-vue/docs/en-US/components/comment/index.md @@ -0,0 +1,48 @@ +# Comment + +A comment displays user feedback and discussion to website content. + +### When To Use + +Comments can be used to enable discussions on an entity such as a page, blog post, issue or other. + +### Basic Usage + +:::demo + +```vue + +``` + +::: + + + +### API + +d-comment +| Parameter | Type | Default | Description | +| :------: | :--: | :--: | :---------------------------------------------- | +| actions | - | - | - | +| author | - | - | The element to display as the comment author | +| avatar | - | - | The element to display as the comment avatar - generally an antd Avatar | +| content | - | - | The main content of the comment | +| datetime | - | - | A datetime element containing the time to be displayed | -- Gitee From e3ee036f5cf7fc77431c8fa92d8dd3ae1b4ac7b5 Mon Sep 17 00:00:00 2001 From: LiuSuY <851209312@qq.com> Date: Sun, 5 Dec 2021 15:00:13 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20pack?= =?UTF-8?q?ages/devui-vue/devui/status/=5F=5Ftests=5F=5F/status.spec.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devui/status/__tests__/status.spec.ts | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 packages/devui-vue/devui/status/__tests__/status.spec.ts diff --git a/packages/devui-vue/devui/status/__tests__/status.spec.ts b/packages/devui-vue/devui/status/__tests__/status.spec.ts deleted file mode 100644 index 28f18878..00000000 --- a/packages/devui-vue/devui/status/__tests__/status.spec.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { mount } from '@vue/test-utils'; -import Status from '../src/status'; - -describe('d-status', () => { - it('type', async () => { - const wrapper = mount(Status, { - props: { type: 'success' } - }); - - expect(wrapper.classes()).toContain('devui-status-bg-success'); - - await wrapper.setProps({type: ''}); - - expect(wrapper.classes()).toContain('devui-status-bg-invalid'); - - await wrapper.setProps({type: null}); - - expect(wrapper.classes()).toContain('devui-status-bg-invalid'); - - await wrapper.setProps({type: undefined}); - - 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' }); - - expect(wrapper.classes()).toContain('devui-status-bg-warning'); - - await wrapper.setProps({type: 'initial'}); - - expect(wrapper.classes()).toContain('devui-status-bg-initial'); - - await wrapper.setProps({type: 'waiting'}); - - expect(wrapper.classes()).toContain('devui-status-bg-waiting'); - - await wrapper.setProps({type: 'running'}); - - expect(wrapper.classes()).toContain('devui-status-bg-running'); - - await wrapper.setProps({type: 'invalid'}); - - expect(wrapper.classes()).toContain('devui-status-bg-invalid'); - - - }); - - it('slot', () => { - const statusText = 'vue3 devui'; - const wrapper = mount(Status, { - slots: { - default: statusText - } - }); - expect(wrapper.text()).toEqual(statusText); - }); -}); -- Gitee From 2b9b52f4e7a75b2b9955adc3d77e5d33b98ab01d Mon Sep 17 00:00:00 2001 From: LiuSuY <851209312@qq.com> Date: Sun, 5 Dec 2021 15:03:49 +0000 Subject: [PATCH 4/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20pack?= =?UTF-8?q?ages/devui-vue/docs/components/comment/index.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/components/comment/index.md | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 packages/devui-vue/docs/components/comment/index.md diff --git a/packages/devui-vue/docs/components/comment/index.md b/packages/devui-vue/docs/components/comment/index.md deleted file mode 100644 index 4d9cca29..00000000 --- a/packages/devui-vue/docs/components/comment/index.md +++ /dev/null @@ -1,48 +0,0 @@ -# Comment 评论 - -对网站内容的反馈、评价和讨论。 - -### 何时使用 - -评论组件可用于对事物的讨论,例如页面、博客文章、问题等等。 - -### 基本评论 - -:::demo - -```vue - -``` - -::: - - - -### API - -d-comment 参数 -| 参数 | 类型 | 默认 | 说明 | -| :------: | :--: | :--: | :---------------------------------------------- | -| actions | - | - | - | -| author | - | - | 要显示为注释作者的元素 | -| avatar | - | - | 要显示为评论头像的元素 - 通常是 avatar | -| content | - | - | 评论的主要内容 | -| datetime | - | - | 展示时间描述 | -- Gitee From 009ddd0d9e25d20e319175fe826534acc28c2fc6 Mon Sep 17 00:00:00 2001 From: LiuSuY <851209312@qq.com> Date: Sun, 5 Dec 2021 15:04:06 +0000 Subject: [PATCH 5/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20pack?= =?UTF-8?q?ages/devui-vue/docs/en-US/components/comment/index.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/en-US/components/comment/index.md | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 packages/devui-vue/docs/en-US/components/comment/index.md diff --git a/packages/devui-vue/docs/en-US/components/comment/index.md b/packages/devui-vue/docs/en-US/components/comment/index.md deleted file mode 100644 index 88678498..00000000 --- a/packages/devui-vue/docs/en-US/components/comment/index.md +++ /dev/null @@ -1,48 +0,0 @@ -# Comment - -A comment displays user feedback and discussion to website content. - -### When To Use - -Comments can be used to enable discussions on an entity such as a page, blog post, issue or other. - -### Basic Usage - -:::demo - -```vue - -``` - -::: - - - -### API - -d-comment -| Parameter | Type | Default | Description | -| :------: | :--: | :--: | :---------------------------------------------- | -| actions | - | - | - | -| author | - | - | The element to display as the comment author | -| avatar | - | - | The element to display as the comment avatar - generally an antd Avatar | -| content | - | - | The main content of the comment | -| datetime | - | - | A datetime element containing the time to be displayed | -- Gitee From c2ecde24441b6328d242524a2a1efda46e0cb7cb Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Sun, 5 Dec 2021 23:06:48 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/components/comment/index.md | 48 ------------------- .../docs/en-US/components/comment/index.md | 48 ------------------- 2 files changed, 96 deletions(-) delete mode 100644 packages/devui-vue/docs/components/comment/index.md delete mode 100644 packages/devui-vue/docs/en-US/components/comment/index.md diff --git a/packages/devui-vue/docs/components/comment/index.md b/packages/devui-vue/docs/components/comment/index.md deleted file mode 100644 index 4d9cca29..00000000 --- a/packages/devui-vue/docs/components/comment/index.md +++ /dev/null @@ -1,48 +0,0 @@ -# Comment 评论 - -对网站内容的反馈、评价和讨论。 - -### 何时使用 - -评论组件可用于对事物的讨论,例如页面、博客文章、问题等等。 - -### 基本评论 - -:::demo - -```vue - -``` - -::: - - - -### API - -d-comment 参数 -| 参数 | 类型 | 默认 | 说明 | -| :------: | :--: | :--: | :---------------------------------------------- | -| actions | - | - | - | -| author | - | - | 要显示为注释作者的元素 | -| avatar | - | - | 要显示为评论头像的元素 - 通常是 avatar | -| content | - | - | 评论的主要内容 | -| datetime | - | - | 展示时间描述 | diff --git a/packages/devui-vue/docs/en-US/components/comment/index.md b/packages/devui-vue/docs/en-US/components/comment/index.md deleted file mode 100644 index 88678498..00000000 --- a/packages/devui-vue/docs/en-US/components/comment/index.md +++ /dev/null @@ -1,48 +0,0 @@ -# Comment - -A comment displays user feedback and discussion to website content. - -### When To Use - -Comments can be used to enable discussions on an entity such as a page, blog post, issue or other. - -### Basic Usage - -:::demo - -```vue - -``` - -::: - - - -### API - -d-comment -| Parameter | Type | Default | Description | -| :------: | :--: | :--: | :---------------------------------------------- | -| actions | - | - | - | -| author | - | - | The element to display as the comment author | -| avatar | - | - | The element to display as the comment avatar - generally an antd Avatar | -| content | - | - | The main content of the comment | -| datetime | - | - | A datetime element containing the time to be displayed | -- Gitee From 582de3288884016c055c27e79c2a94659db818d9 Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Mon, 6 Dec 2021 15:49:56 +0800 Subject: [PATCH 7/8] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20packages/devui-vue/docs/components/comment/index.md?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b9b52f4e7a75b2b9955adc3d77e5d33b98ab01d. --- .../docs/components/comment/index.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 packages/devui-vue/docs/components/comment/index.md diff --git a/packages/devui-vue/docs/components/comment/index.md b/packages/devui-vue/docs/components/comment/index.md new file mode 100644 index 00000000..4d9cca29 --- /dev/null +++ b/packages/devui-vue/docs/components/comment/index.md @@ -0,0 +1,48 @@ +# Comment 评论 + +对网站内容的反馈、评价和讨论。 + +### 何时使用 + +评论组件可用于对事物的讨论,例如页面、博客文章、问题等等。 + +### 基本评论 + +:::demo + +```vue + +``` + +::: + + + +### API + +d-comment 参数 +| 参数 | 类型 | 默认 | 说明 | +| :------: | :--: | :--: | :---------------------------------------------- | +| actions | - | - | - | +| author | - | - | 要显示为注释作者的元素 | +| avatar | - | - | 要显示为评论头像的元素 - 通常是 avatar | +| content | - | - | 评论的主要内容 | +| datetime | - | - | 展示时间描述 | -- Gitee From 169ec75c8b41a6f94b6edd590fb1a837d5435275 Mon Sep 17 00:00:00 2001 From: liusuY <851209312@qq.com> Date: Mon, 6 Dec 2021 15:50:01 +0800 Subject: [PATCH 8/8] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20packages/devui-vue/devui/status/=5F=5Ftests=5F=5F/s?= =?UTF-8?q?tatus.spec.ts"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e3ee036f5cf7fc77431c8fa92d8dd3ae1b4ac7b5. --- .../devui/status/__tests__/status.spec.ts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packages/devui-vue/devui/status/__tests__/status.spec.ts diff --git a/packages/devui-vue/devui/status/__tests__/status.spec.ts b/packages/devui-vue/devui/status/__tests__/status.spec.ts new file mode 100644 index 00000000..28f18878 --- /dev/null +++ b/packages/devui-vue/devui/status/__tests__/status.spec.ts @@ -0,0 +1,60 @@ +import { mount } from '@vue/test-utils'; +import Status from '../src/status'; + +describe('d-status', () => { + it('type', async () => { + const wrapper = mount(Status, { + props: { type: 'success' } + }); + + expect(wrapper.classes()).toContain('devui-status-bg-success'); + + await wrapper.setProps({type: ''}); + + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + await wrapper.setProps({type: null}); + + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + await wrapper.setProps({type: undefined}); + + 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' }); + + expect(wrapper.classes()).toContain('devui-status-bg-warning'); + + await wrapper.setProps({type: 'initial'}); + + expect(wrapper.classes()).toContain('devui-status-bg-initial'); + + await wrapper.setProps({type: 'waiting'}); + + expect(wrapper.classes()).toContain('devui-status-bg-waiting'); + + await wrapper.setProps({type: 'running'}); + + expect(wrapper.classes()).toContain('devui-status-bg-running'); + + await wrapper.setProps({type: 'invalid'}); + + expect(wrapper.classes()).toContain('devui-status-bg-invalid'); + + + }); + + it('slot', () => { + const statusText = 'vue3 devui'; + const wrapper = mount(Status, { + slots: { + default: statusText + } + }); + expect(wrapper.text()).toEqual(statusText); + }); +}); -- Gitee