As a newcomer to vue.js
, I have a child component called 'test' and a parent component called 'showdata'. My issue arises when I try to emit data from the child to the parent - while the emission is successful, displaying the data in the parent using
@click="showusersdata1(listdata.id)
results in empty data being shown, as seen in the attached image. How can I successfully display user data?
<template>
<div>
id={{setUserData.id}},
name={{setUserData.name}}
email={{setUserData.email}}
<test v-on:showusersdata1="userData($event)"></test>
</div>
</template>
...
... (remaining code omitted for brevity)
...
Here is my code snippet for the 'test.vue' file:
<template>
<div class="row">
<div class="col-8">
<h1>This is the test components1</h1>
...
... (remaining code omitted for brevity)
...
</script>
<style scoped>
.test{
float:right
}
</style>