recieve the emited data in App.vue

This commit is contained in:
Andreas Zweili 2021-02-02 22:20:02 +01:00
parent ed8f6ea458
commit 55ab94d8f8

View File

@ -2,7 +2,7 @@
<div>
<h1>User App</h1>
<active-user :username="user.username" :age="user.age"></active-user>
<user-data></user-data>
<user-data @active-user="setActiveUser"></user-data>
</div>
</template>
@ -16,6 +16,11 @@ export default {
},
};
},
methods: {
setActiveUser(user) {
this.user = user;
},
},
};
</script>