Permalink
Browse files

data, methods, computed, created, props başlıkları için çalışma yapıldı

  • Loading branch information...
erselgulyaz committed Apr 10, 2018
1 parent bdef553 commit b0f6cf13183fdacf1ce2498f1b4db4415da13ca6
Showing with 58 additions and 1 deletion.
  1. +39 −1 src/App.vue
  2. +19 −0 src/components/BasicComponent.vue
View
@@ -1,15 +1,53 @@
<template>
<div id="app">
{{message}}
<hr>
<span>Toplam Ürün Sayısı: {{productTotal}}</span>
<button @click="addNewItem()">SEPETE EKLE</button>
<hr>
<hr>
<hr>
<hr>
<hr>
<hr>
<basic-component itemTitle="Başlık Alanı" itemContent="İçerik Alanı" />
</div>
</template>
<script>
import BasicComponent from './components/BasicComponent.vue'
export default {
data () {
return {
message: 'Hello World!'
message: 'Hello World!',
products: [
{
name: 'Ürün 1'
}
]
}
},
methods: {
alertFunc () {
alert('Hello World!')
},
addNewItem () {
let item = {
name: 'Ürün x'
}
this.products.push(item)
}
},
computed: {
productTotal () {
return this.products.length
}
},
created () {
alert('sayfa yüklendi')
},
components: {
BasicComponent
}
}
</script>
@@ -0,0 +1,19 @@
<template>
<div>
{{ itemTitle }}
<hr>
{{ itemContent }}
</div>
</template>
<script>
export default {
props: {
itemTitle: { type: String, required: true },
itemContent: { type: String }
}
}
</script>
<style scoped>
</style>

0 comments on commit b0f6cf1

Please sign in to comment.