Here is the code snippet I am working with:
<template>
<div>
<ul v-if="list.length !== 0">
{{
list
}}
</ul>
</div>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: () => {
return []
},
},
},
}
</script>
However, I'm encountering an error on a particular line and have tried various solutions without success.
You can view the error message at this link: https://i.sstatic.net/PUFRi.png
I have also attempted to implement the solution provided in this Stack Overflow thread, but nothing seems to be resolving the issue: Vue 2 - How to set default type of array in props