
3 changed files with 45 additions and 4 deletions
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,42 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
Cihly |
||||
|
{{ pocet }} |
||||
|
|
||||
|
<img v-on:click="prilozit(c)" v-for="c in hromada" :key="c" src="../assets/brick.png" alt=""> |
||||
|
|
||||
|
<hr> |
||||
|
<img v-for="i in komin" :key="i" src="../assets/brick.png" alt=""> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'Cihly', |
||||
|
data: function(){ |
||||
|
return{ |
||||
|
hromada: [1, 2, 3, 4, 5], |
||||
|
komin: [], |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
prilozit: function(c) { |
||||
|
this.komin.push(c, 1); |
||||
|
this.hromada.splice(this.hromada.indexOf(c),1); |
||||
|
|
||||
|
}, |
||||
|
}, |
||||
|
props: { |
||||
|
pocet: {default: () => 0}, |
||||
|
}, |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
img{ |
||||
|
width: 50px; |
||||
|
} |
||||
|
|
||||
|
</style> |
Loading…
Reference in new issue