From 0d46d99022bc71487b27ccb1fa8d1568ea2fa73e Mon Sep 17 00:00:00 2001
From: wzc520pyfm <69044080+wzc520pyfm@users.noreply.github.com>
Date: Wed, 3 May 2023 09:33:59 +0800
Subject: [PATCH] docs(style): [tag] use new display tag (#12659)
* docs(style): [tag] use new display tag
* refactor(components): [check] updated doc and code to new display tag
* docs(components): [tag] update format of doc
* style(components): [tag] undo redundant changes
* style(components): [tag] undo redundant changes and update tag doc
---
docs/en-US/component/tag.md | 57 ++++++++++---------
.../components/check-tag/src/check-tag.ts | 3 +
.../components/check-tag/src/check-tag.vue | 4 +-
packages/components/tag/src/tag.ts | 28 ++++++++-
packages/components/tag/src/tag.vue | 6 +-
5 files changed, 66 insertions(+), 32 deletions(-)
diff --git a/docs/en-US/component/tag.md b/docs/en-US/component/tag.md
index 825eefce2d..ac9af1cc03 100644
--- a/docs/en-US/component/tag.md
+++ b/docs/en-US/component/tag.md
@@ -73,45 +73,50 @@ tag/checkable
:::
-## Attributes
+## Tag API
-| Name | Description | Type | Accepted Values | Default |
-| ------------------- | ------------------------------------ | ------- | --------------------------- | ------- |
-| type | component type | string | success/info/warning/danger | — |
-| closable | whether Tag can be removed | boolean | — | false |
-| disable-transitions | whether to disable animations | boolean | — | false |
-| hit | whether Tag has a highlighted border | boolean | — | false |
-| color | background color of the Tag | string | — | — |
-| size | tag size | string | large / default /small | default |
-| effect | component theme | string | dark / light / plain | light |
-| round | whether Tag is rounded | boolean | — | false |
+### Tag Attributes
-## Events
+| Name | Description | Type | Default |
+| ------------------- | ------------------------------------ | ----------------------------------------------------------- | ------- |
+| type | type of Tag | ^[enum]`'success' \| 'info' \| 'warning' \| 'danger' \| ''` | '' |
+| closable | whether Tag can be removed | ^[boolean] | false |
+| disable-transitions | whether to disable animations | ^[boolean] | false |
+| hit | whether Tag has a highlighted border | ^[boolean] | false |
+| color | background color of the Tag | ^[string] | '' |
+| size | size of Tag | ^[enum]`'large' \| 'default' \| 'small' \| ''` | '' |
+| effect | theme of Tag | ^[enum]`'dark' \| 'light' \| 'plain'` | light |
+| round | whether Tag is rounded | ^[boolean] | false |
-| Name | Description | Parameters |
-| ----- | ---------------------------- | ---------- |
-| click | triggers when Tag is clicked | — |
-| close | triggers when Tag is removed | — |
+### Tag Events
-## Slots
+| Name | Description | Type |
+| ----- | ---------------------------- | -------------------------------------- |
+| click | triggers when Tag is clicked | ^[Function]`(evt: MouseEvent) => void` |
+| close | triggers when Tag is removed | ^[Function]`(evt: MouseEvent) => void` |
+
+### Tag Slots
| Name | Description |
| ---- | ------------------------- |
| — | customize default content |
-## CheckTag Attributes
-| Name | Description | Type | Accepted Values | Default |
-| ------- | ----------- | ------- | --------------- | ------- |
-| checked | is checked | boolean | true/false | — |
+## CheckTag API
-## CheckTag Events
+### CheckTag Attributes
-| Name | Description | Parameters |
-| ------ | ---------------------------------- | ---------- |
-| change | triggers when Check Tag is clicked | checked |
+| Name | Description | Type | Default |
+| ------------------------- | ----------- | ---------- | ------- |
+| checked / v-model:checked | is checked | ^[boolean] | false |
-## CheckTag Slots
+### CheckTag Events
+
+| Name | Description | Type |
+| ------ | ---------------------------------- | ------------------------------------- |
+| change | triggers when Check Tag is clicked | ^[Function]`(value: boolean) => void` |
+
+### CheckTag Slots
| Name | Description |
| ---- | ------------------------- |
diff --git a/packages/components/check-tag/src/check-tag.ts b/packages/components/check-tag/src/check-tag.ts
index c9239c53e8..b8bc99e4fc 100644
--- a/packages/components/check-tag/src/check-tag.ts
+++ b/packages/components/check-tag/src/check-tag.ts
@@ -5,6 +5,9 @@ import type CheckTag from './check-tag.vue'
import type { ExtractPropTypes } from 'vue'
export const checkTagProps = buildProps({
+ /**
+ * @description is checked
+ */
checked: {
type: Boolean,
default: false,
diff --git a/packages/components/check-tag/src/check-tag.vue b/packages/components/check-tag/src/check-tag.vue
index a1a2409ba8..9ff65faa42 100644
--- a/packages/components/check-tag/src/check-tag.vue
+++ b/packages/components/check-tag/src/check-tag.vue
@@ -1,10 +1,11 @@
-
+