From dd87d9f3054956101a1aa33dbc65fa85fb7f877a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Wed, 12 Jul 2023 22:18:30 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=AD=97=E5=85=B8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9E=E5=88=86=E5=89=B2=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictTag/index.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue index 8545d0e..90eefc4 100644 --- a/src/components/DictTag/index.vue +++ b/src/components/DictTag/index.vue @@ -23,15 +23,21 @@ const props = defineProps({ // 数据 options: { type: Array, - default: null, + default: null }, // 当前的值 value: [Number, String, Array, Boolean], showValue: false, + split: { + type: String, + default: null + } }) const values = computed(() => { - if (props.value !== null && typeof props.value !== 'undefined') { + if (props.split != null && props.split != '') { + return props.value.split(props.split) ?? [] + } else if (props.value !== null && typeof props.value !== 'undefined') { return Array.isArray(props.value) ? props.value : [String(props.value)] } else { return []