Essentially, I'm working on creating a dynamic array in Vue3. Each time a button is clicked, the length of the array should increase. Below is the code snippet.
<div class="package-item" v-for="n in arraySize"></div>
export default {
methods: {
data () {
return {
arraySize: 1
}
},
arrayAppend () {
if (this.arraySize) {
this.arraySize++
}
}
}
}
An error message related to 'arraySize' has popped up:
Property 'arraySize' does not exist on type '{ data(): { arraySize: number; }; textareacharct(): void; addInline(key: any): void; hoverRender(): number; arrayAppend(): void;
It seems like I'm facing some challenges with Vue. Any guidance or assistance would be greatly appreciated.
I attempted using defineComponent after export default, and whenever I added
import { defineComponent } from 'vue'
I kept encountering an issue stating
could not find defineComponent
for which I couldn't find a solution ANYWHERE online.