add customer table and row components

This commit is contained in:
2017-02-20 14:09:29 -07:00
parent 97f58b0fb3
commit 5bf0aa24a0
3 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<template>
<tr>
<td>{{ this.name }}</td>
<td>{{ customer.email }}</td>
<td>{{ customer.city }}, {{ customer.state }}</td>
<td></td>
</tr>
</template>
<script>
export default {
name: 'customer-row',
props: {
customer: {
type: Object,
required: true,
validator(value) {
const props = [
'firstname',
'lastname',
'email',
'city',
'state',
];
return props.every(prop => !!value[prop]);
}
}
},
computed: {
name() {
return `${this.customer.firstname} ${this.customer.lastname}`;
},
},
}
</script>