I am currently utilizing the Vue-Multiselect plugin and attempting to send data up to a parent component so that a backend API can update certain records. However, I am facing challenges in achieving this successfully.
My approach (explained in detail) along with a CodeSandBox Demo can be viewed for a better understanding. Note: To view the functionality of the multiselect UI, navigate to POST-->ACME WIDGET and click "Edit" to interact with the multiselect plugin.
In my child component CustomerPOCSelect.vue
, there are events such as onRemove
and onSelect
which push data into arrays named pocsToRemove
and pocsToAdd
respectively.
However, I need assistance in bridging the gap between this point and the parent component
EditPost.vue</code, where I can utilize the <code>onSubmitUpdate
event handler to actually update the server. Whenever a user makes changes to the multiselect input (additions or removals) and clicks the UPDATE POST button, I must pass on the emitted data to the onSubmitUpdate method.
EditPost.vue
<template>
// Code for EditPost.vue template
</template>
<script>
// Script for EditPost.vue
</script>
CustomerPOCSelect.vue
<template>
// Code for CustomerPOCSelect.vue template
</template>
<script>
// Script for CustomerPOCSelect.vue
</script>