From 2737b0aa8344062dc1f37c15b3106e5112578c89 Mon Sep 17 00:00:00 2001 From: zhaojinfeng <121016171@qq.com> Date: Sun, 23 Jul 2023 17:54:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mask-text/index.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/mask-text/index.vue b/packages/mask-text/index.vue index bbe0962..8807700 100644 --- a/packages/mask-text/index.vue +++ b/packages/mask-text/index.vue @@ -2,7 +2,7 @@ * @Author: zhaojinfeng 121016171@qq.com * @Date: 2023-07-23 16:27:37 * @LastEditors: zhaojinfeng 121016171@qq.com - * @LastEditTime: 2023-07-23 17:28:40 + * @LastEditTime: 2023-07-23 17:54:15 * @FilePath: \vue3\packages\mask-text\index.vue * @Description: 敏感数据隐藏组件 * @@ -26,13 +26,14 @@ const props = withDefaults(defineProps<{ const [value, toggle] = useToggle(true) const data = computed(() => { - if (!value.value || !props.text) + if (!props.text) return '' const left = props.left < 0 ? 0 : props.left const right = props.right < 0 ? 0 : props.right const textLength = props.text.length - if (left > textLength + if (!value.value + || left > textLength || right > textLength || right + left > textLength )