Skip to content

Commit 9d1a6ca

Browse files
author
Shaun Pelling
committed
added lesson code
1 parent a7c04be commit 9d1a6ca

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

src/App.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<template>
22
<div>
33
<h1>{{ title }}</h1>
4-
<p>{{ greeting() }}</p>
4+
<ninjas></ninjas>
55
</div>
66
</template>
77

88
<script>
9+
// Imports
10+
import Ninjas from './Ninjas.vue';
11+
912
export default {
13+
components: {
14+
'ninjas': Ninjas
15+
},
1016
data () {
1117
return {
12-
title: 'Your first Vue file, wooo!'
13-
}
14-
},
15-
methods: {
16-
greeting: function(){
17-
return 'heeey cowboy'
18+
title: 'Ninja App'
1819
}
1920
}
2021
}

src/Ninjas.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<ul>
3+
<li v-for="ninja in ninjas">{{ ninja }}</li>
4+
</ul>
5+
</template>
6+
7+
<script>
8+
export default {
9+
data () {
10+
return {
11+
ninjas: ['Yoshi', 'Mario', 'Ryu']
12+
}
13+
}
14+
}
15+
</script>
16+
17+
<style>
18+
</style>

src/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Vue from 'vue'
22
import App from './App.vue'
3+
//import Ninjas from './Ninjas.vue'
4+
5+
//Vue.component('ninjas', Ninjas);
36

47
new Vue({
58
el: '#app',

0 commit comments

Comments
 (0)