Let's say I've imported a component called <pic-upload>
into the template like this:
<template>
<pic-upload></pic-upload>
</template>
export default {
data: () => ({
show: {
content: '',
recommend: false,
albums: []
}
}),
components: {
picUpload
},
methods: {
submit: function () {
dataService.postpic(this.show).then(() => {
this.$toast({
message: 'success'
})
})
}
}
}
In the <pic-upload>
component, it provides data and a method as follows:
// pic-upload component
export default {
data () {
return {
imgList: []
}
},
methods: {
getUploadedImgList () {
return this.imgList
}
}
}
How can I access the value of imgList
array in the template
component so that I can send the data to the server?