From e421d3c06b8283b8b9433727d40e8876169137fd Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Tue, 17 Apr 2018 21:44:21 -0400 Subject: [PATCH] s8e111 callbacks --- section-code/src/components/User.vue | 9 ++++++++- section-code/src/components/UserDetail.vue | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/section-code/src/components/User.vue b/section-code/src/components/User.vue index be00ce3..e66a851 100644 --- a/section-code/src/components/User.vue +++ b/section-code/src/components/User.vue @@ -6,7 +6,11 @@
- +
@@ -29,6 +33,9 @@ changeName(){ this.name = "TyrelSouza" }, + resetName(){ + this.name = 'Tyrel'; + } }, components: { appUserDetail: UserDetail, diff --git a/section-code/src/components/UserDetail.vue b/section-code/src/components/UserDetail.vue index 686fb4f..45e00ab 100644 --- a/section-code/src/components/UserDetail.vue +++ b/section-code/src/components/UserDetail.vue @@ -2,8 +2,9 @@

You may view the User Details here

Many Details

-

User Name: {{ name }}

+

User Name: {{ switchName() }}

+
@@ -12,9 +13,15 @@ props: { name: { type: String, + }, + resetFn: { + type: Function } }, methods: { + switchName(){ + return this.name.split("").reverse().join(""); + }, resetName(){ this.name = 'Tyrel'; this.$emit('nameWasReset', this.name)