Issue
I already tried using ? after every word, I already tried something like this:
const totalNameLenght = computed(() => {
if (userFirstnameLenght.value && userLastnameLenght.value){
return userFirstnameLenght.value + userLastnameLenght.value
}
})
also tried this one:
const totalNameLenght = computed((): number | undefined => )
I don't know what else to try... how should I solve this? Thanks in advance!
Solution
you can try:
const totalNameLength = computed(() => {
return Number(userFirstnameLenght?.value ?? 0) + Number(userLastnameLenght?.value ?? 0)
})
Answered By - IZEM
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.