I am learning VueJs, in this sandbox https://codesandbox.io/s/o29j95wx9 it has lines like this
<script>
export default {
props: {
value: {
type: String,
default: '',
}
},
computed: {
listeners () {
return {
// Pass all component listeners directly to input
...this.$listeners,
// Override input listener to work with v-model
input: event => this.$emit('input', event.target.value)
}
}
}
}
</script>
What does the ...
in ...this.$listeners,
do? I tried searching for it but every search engine filters out that query. I don't know what it's called.
I also see it used in vuex like this
computed: {
...mapGetters({
currentData: 'viewerGetCurrentDocument',
folders: 'viewerGetFoldersList'
}),