We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87ea49b commit 721435aCopy full SHA for 721435a
src/App.vue
@@ -1,6 +1,6 @@
1
<template>
2
<div>
3
- <app-header v-bind:title="title"></app-header>
+ <app-header v-bind:title="title" v-on:changeTitle="updateTitle($event)"></app-header>
4
<app-ninjas v-bind:ninjas="ninjas"></app-ninjas>
5
<ul>
6
<li v-for="ninja in ninjas">{{ ninja.name }}</li>
@@ -33,6 +33,11 @@ export default {
33
],
34
title: 'Vue Wizards'
35
}
36
+ },
37
+ methods: {
38
+ updateTitle: function(updatedTitle){
39
+ this.title = updatedTitle;
40
+ }
41
42
43
</script>
src/components/Header.vue
@@ -18,7 +18,7 @@ export default {
18
},
19
methods: {
20
changeTitle: function(){
21
- this.title = 'Vue Ninjas';
+ this.$emit('changeTitle', 'Vue Ninjas');
22
23
24
0 commit comments