This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
seepur/resources/scripts/applications/home/components/Child_Card.vue

41 lines
910 B
Vue
Raw Permalink Normal View History

2020-03-17 22:16:34 +00:00
<template>
<!-- <div class="card"> -->
<!-- <div class="card-content " > -->
<article class="media has-pointer" @click="goToChild(child)">
<div class="media-left">
<figure class="image is-48x48">
<img class="is-rounded is-avatar" :src="child.avatar" :alt="child.name" />
</figure>
</div>
<div class="media-content">
<div class="content">
2020-03-17 22:16:34 +00:00
<p class>{{child.name}}</p>
</div>
<!-- <p class>{{childAge}}</p> -->
2020-03-17 22:16:34 +00:00
</div>
</article>
<!-- </div> -->
2020-03-17 22:16:34 +00:00
<!-- </div> -->
</template>
<script lang="ts">
2020-04-12 14:25:42 +00:00
import Moment from "moment";
2020-03-17 22:16:34 +00:00
let childAge;
export default {
name: "ChildCard",
props: ["child"],
2020-04-12 14:25:42 +00:00
methods: {
goToChild(child) {
this.$router.push({ path: `/child/${child.id}` });
}
},
2020-03-17 22:16:34 +00:00
created() {
this.childAge = Moment().diff(this.child.dob, "years");
},
data() {
return {
childAge
};
}
};
</script>