diff --git a/packages/mask-text/index.vue b/packages/mask-text/index.vue index 12fd5ee..bbe0962 100644 --- a/packages/mask-text/index.vue +++ b/packages/mask-text/index.vue @@ -26,13 +26,13 @@ const props = withDefaults(defineProps<{ const [value, toggle] = useToggle(true) const data = computed(() => { + if (!value.value || !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 ( - !value.value - || !props.text - || left > textLength + if (left > textLength || right > textLength || right + left > textLength )