Component をさらに細かく Component に分ける
Tweet- Memebr Component を更に分割し、Height Component を作る
/components/Member.vue
<template>
<div class="memberComponent">
{{member.name}} {{member.position}}
<Height :height="member.height"/>
</div>
</template>
<script>
import Height from "./Height";
export default {
components: {
Height
},
props: {
member: Object
}
};
</script>
<style scoped>
.memberComponent {
border: 1px solid blue;
}
</style>
/components/Height.vue
<template>
<span class="heightComponent">
身長:{{height}}
<button>+</button>
<button>-</button>
</span>
</template>
<script>
export default {
props: {
height: Number
}
};
</script>
<style scoped>
.heightComponent {
border: 1px solid green;
}
</style>