fix: text未定义时的报错问题
This commit is contained in:
@ -26,13 +26,13 @@ const props = withDefaults(defineProps<{
|
|||||||
const [value, toggle] = useToggle(true)
|
const [value, toggle] = useToggle(true)
|
||||||
|
|
||||||
const data = computed(() => {
|
const data = computed(() => {
|
||||||
|
if (!value.value || !props.text)
|
||||||
|
return ''
|
||||||
|
|
||||||
const left = props.left < 0 ? 0 : props.left
|
const left = props.left < 0 ? 0 : props.left
|
||||||
const right = props.right < 0 ? 0 : props.right
|
const right = props.right < 0 ? 0 : props.right
|
||||||
const textLength = props.text.length
|
const textLength = props.text.length
|
||||||
if (
|
if (left > textLength
|
||||||
!value.value
|
|
||||||
|| !props.text
|
|
||||||
|| left > textLength
|
|
||||||
|| right > textLength
|
|| right > textLength
|
||||||
|| right + left > textLength
|
|| right + left > textLength
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user