Browse Source

cihly

master
mist 4 years ago
parent
commit
eecd502e4f
  1. 10
      README.md
  2. 16
      src/App.vue
  3. BIN
      src/assets/brick.png
  4. 44
      src/components/Cihly.vue

10
README.md

@ -1,5 +1,15 @@
# cihly # cihly
## Instalace vue + vue-cli
Předpokladem je nainstalovaný nodejs.
> cd C:\Users\uzivatel\Desktop
> npm install @vue/cli
> node_modules\.bin\vue create cihly
> cd cihly
> npm run serve
## Project setup ## Project setup
``` ```
npm install npm install

16
src/App.vue

@ -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>

BIN
src/assets/brick.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

44
src/components/Cihly.vue

@ -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…
Cancel
Save