fix: text未定义时的报错问题
This commit is contained in:
@ -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
|
||||
)
|
||||
|
Reference in New Issue
Block a user