
4 changed files with 58 additions and 12 deletions
@ -1,28 +1,20 @@ |
|||||
<template> |
<template> |
||||
<div id="app"> |
<div id="app"> |
||||
<img alt="Vue logo" src="./assets/logo.png"> |
|
||||
<HelloWorld msg="Welcome to Your Vue.js App"/> |
|
||||
|
<Cihly pocet="25" /> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import HelloWorld from './components/HelloWorld.vue' |
|
||||
|
import Cihly from './components/Cihly.vue' |
||||
|
|
||||
export default { |
export default { |
||||
name: 'App', |
name: 'App', |
||||
components: { |
components: { |
||||
HelloWorld |
|
||||
|
Cihly |
||||
} |
} |
||||
} |
} |
||||
</script> |
</script> |
||||
|
|
||||
<style> |
<style> |
||||
#app { |
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif; |
|
||||
-webkit-font-smoothing: antialiased; |
|
||||
-moz-osx-font-smoothing: grayscale; |
|
||||
text-align: center; |
|
||||
color: #2c3e50; |
|
||||
margin-top: 60px; |
|
||||
} |
|
||||
|
|
||||
</style> |
</style> |
||||
|
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,44 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<img v-on:click="prilozit(i)" v-for="i in hromada" :key="i" 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: [0, 1, 2, 3, 4, 5], |
||||
|
komin: [], |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
prilozit: function(i) { |
||||
|
this.hromada.splice(this.hromada.indexOf(i), 1); |
||||
|
this.komin.push(i); |
||||
|
|
||||
|
}, |
||||
|
}, |
||||
|
props: { |
||||
|
pocet: {default: () => 0}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
<style scoped> |
||||
|
img { |
||||
|
width: 60px; |
||||
|
} |
||||
|
|
||||
|
img:hover { |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue