This repository has been archived on 2021-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
2021-02-02 21:56:40 +01:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<h1>User App</h1>
|
2021-02-02 22:06:20 +01:00
|
|
|
<active-user :username="user.username" :age="user.age"></active-user>
|
2021-02-02 22:20:02 +01:00
|
|
|
<user-data @active-user="setActiveUser"></user-data>
|
2021-02-02 21:56:40 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-02-02 22:06:20 +01:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
user: {
|
|
|
|
username: "Peter Paul",
|
|
|
|
age: 18,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
2021-02-02 22:20:02 +01:00
|
|
|
methods: {
|
|
|
|
setActiveUser(user) {
|
|
|
|
this.user = user;
|
|
|
|
},
|
|
|
|
},
|
2021-02-02 22:06:20 +01:00
|
|
|
};
|
2021-02-02 21:56:40 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|