From 8b6f7279508cf68a56819baf6065cc2f378bbfa0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com>
Date: Thu, 22 Sep 2022 19:01:13 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(component):=20=E8=B0=83=E6=95=B4=20ta?=
=?UTF-8?q?g=20=E6=A0=B7=E5=BC=8F,=20=E7=AE=80=E5=8C=96=E6=96=87=E6=A1=A3?=
=?UTF-8?q?=20demo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../component/src/component/tag/index.less | 7 +-
.../src/document/zh-CN/components/tag.md | 182 ++++--------------
2 files changed, 45 insertions(+), 144 deletions(-)
diff --git a/package/component/src/component/tag/index.less b/package/component/src/component/tag/index.less
index ac372024..07e2df30 100644
--- a/package/component/src/component/tag/index.less
+++ b/package/component/src/component/tag/index.less
@@ -7,7 +7,7 @@
@tagSizes: lg, md, sm, xs;
- @tag-size-default: 28px;
+ @tag-size-default: 26px;
@tag-size-default-font-size: 14px;
@tag-size-lg: @tag-size-default + 4px;
@tag-size-md: @tag-size-default;
@@ -20,8 +20,8 @@
@tag-border-width: 1px;
.layui-tag {
- --layui-tag-bg-color: #FFF;
- --layui-tag-border-color: var(--global-neutral-color-5);
+ --layui-tag-bg-color: #fafafa;
+ --layui-tag-border-color: #f0f0f0;
--layui-tag-hover-color: #FFF;
--layui-tag-text-color: currentColor;
display: inline-flex;
@@ -81,7 +81,6 @@
text-overflow: ellipsis
}
-
& &-close-icon {
margin-left: 4px;
font-size: @tag-size-default-font-size;
diff --git a/package/document-component/src/document/zh-CN/components/tag.md b/package/document-component/src/document/zh-CN/components/tag.md
index b3f1fa12..ffe3503f 100644
--- a/package/document-component/src/document/zh-CN/components/tag.md
+++ b/package/document-component/src/document/zh-CN/components/tag.md
@@ -4,72 +4,58 @@
::: title 基本介绍
:::
-::: describe 标签组件
+::: describe 进行标记和分类的小标签, 用于标记事物的属性与纬度。
:::
::: title 基础使用
:::
-::: demo 标签的基本用法
+::: demo 使用 `lay-tag` 标签, 创建标签组件。
-
- 标签
- 标签
- 标签
- 超过设置长度省略文本
-
+
+ 标签
+ 标签
+
-
:::
-::: title 标签尺寸
+::: title 图标插槽
:::
-::: demo 通过 size 属性控制标签尺寸
+::: demo 通过 icon 插槽自定义 tag 前置图标。
-
- lg:
- 标签
- 标签
-
-
- 标签
+
+
+
+
+ tag
-
-
- md:
- 标签
- 标签
-
-
- 标签
+
+
+
+
+ tag
-
-
- sm:
- 标签
- 标签
-
-
- 标签
+
+
+
+
+ tag
-
- xs:
- 标签
- 标签
-
-
- 标签
-
-
-
-
-
-:::
-
::: title 动态编辑
:::
-::: demo
+::: demo 配合自定义逻辑, 实现标签的动态编辑
- {{ tagData }}
-
{{tag}}
@@ -278,7 +181,6 @@ const COLORS = [
@blur="handleAdd" />
@@ -293,7 +195,7 @@ import { ref, nextTick } from 'vue';
export default {
setup() {
- const tagData = ref(['Tag']);
+ const tagData = ref(['Tag', 'Selected', 'Tags']);
const inputRef = ref(null);
const showInput = ref(false);
const inputVal = ref('');