In a current project, I have a component in which I am using v-for to iterate over a draggable JS component.
<div v-for="(val, index) in rows" :key="index"><draggable></draggable/></div>
The property rows in my computed is responsible for returning an array of arrays. This array is obtained from the parent component using v-model.
props: {
array: {
type: Array,
required: false,
default: null
}
},
computed: {
rows () {
if (isTrue) {
const arr = this.array.map((v) => v.slice())
const temp = doSomething(arr)
return temp
} else if (isFalse) {
const arr = this.array.filter(elm => elm.length)
return arr
}
return this.array
}
Unfortunately, I've encountered an error message: 'Cannot read property 'Sortable1616400528253' of null'. When I replace rows with array, the error disappears but the output is incorrect, indicating there might be an issue with how rows is being handled. Any advice or suggestions on what could be going wrong?