s8e107 props in child components

This commit is contained in:
Tyrel Souza 2018-04-17 21:19:22 -04:00
parent 0c19dcf46a
commit db1e4c63d2
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0

View File

@ -2,13 +2,18 @@
<div class="component"> <div class="component">
<h3>You may view the User Details here</h3> <h3>You may view the User Details here</h3>
<p>Many Details</p> <p>Many Details</p>
<p>User Name: {{ name }}</p> <p>User Name: {{ switchName() }}</p>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: ['name'] props: ['name'],
methods: {
switchName(){
return this.name.split("").reverse().join("");
}
}
} }
</script> </script>