In my Vue project, I have a parent component called ChangeInfo which contains a child component named ShowWorkInfo. The ShowWorkInfo component includes several input forms for updating job information. To manage the data input, I created an object variable called work_info and used v-model to bind the form fields. However, I'm unsure how to pass this data from the child component to the parent component without any buttons in the child component. I am considering whether it would be better to combine everything into the ChangeInfo component instead of splitting it up. Here is a snippet of my code.
ChangeInfo (parent component)
export default class ChangeInfo extends Vue {
public isUpdated: boolean = false
// Rest of the script remains unchanged...
I make use of two functions like so:
<template>
<div class="d-block">
<ShowProfile />
<ShowWorkInfo :isUpdated="isUpdated" @update-work-info="updateWorkInfo" />
<ShowPersonalInfo
:isUpdated="isUpdated"
@update-personal-info="updatePersonalInfo"
/>
<div class="w--27 mw-100 mx-auto my-9">
<button
@click="triggerSubmit"
v-b-modal="'update-success'"
class="btn btn-primary w-100"
>
{{ $t('common.btn.btn_update') }}
</button>
</div>
<ModalUpdateSuccess />
</div>
</template>