From de9ec9509932bfb45b637bc700367b8db6139482 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 8 Aug 2024 23:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91DictTag=20=E7=9A=84=20render=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E5=91=BD=E5=90=8D=EF=BC=8C=E5=B1=9E=E6=80=A7=E7=9A=84?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictTag/src/DictTag.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index b82b97c3..f84a47cb 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -17,12 +17,12 @@ export default defineComponent({ required: true }, // 字符串分隔符 只有当 props.value 传入值为字符串时有效 - sepSymbol: { + separator: { type: String as PropType, default: ',' }, - // 每个tag之间的间隔,默认为5px - tagSpacing: { + // 每个 tag 之间的间隔,默认为 5px,参考的 el-row 的 gutter + gutter: { type: String as PropType, default: '5px' } @@ -35,7 +35,7 @@ export default defineComponent({ } // 2.是字符串(进一步判断是否有包含分隔符号 -> props.sepSymbol ) else if (isString(props.value)) { - return props.value.split(props.sepSymbol) + return props.value.split(props.separator) } // 3.数组 else if (isArray(props.value)) { @@ -43,7 +43,7 @@ export default defineComponent({ } return [] }) - const rederDictTag = () => { + const renderDictTag = () => { if (!props.type) { return null } @@ -58,7 +58,7 @@ export default defineComponent({ class="dict-tag" style={{ display: 'flex', - gap: props.tagSpacing, + gap: props.gutter, justifyContent: 'center', alignItems: 'center' }} @@ -84,7 +84,7 @@ export default defineComponent({ ) } - return () => rederDictTag() + return () => renderDictTag() } })