5 changed files with 141 additions and 27 deletions
@ -0,0 +1,41 @@ |
|||||
|
<template> |
||||
|
<div class="hello"> |
||||
|
<h1>{{ msg }}</h1> |
||||
|
<div class="card"> |
||||
|
<div class="card-body"> |
||||
|
<h5 class="card-title">{{ name }} | Věk: {{ age }}</h5> |
||||
|
<h6 class="card-subtitle mb-2 text-body-secondary">{{ pos }}</h6> |
||||
|
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Aperiam pariatur voluptas natus error deleniti saepe odio, aliquam vel beatae eaque nemo, minima laborum, iste provident obcaecati impedit rerum aspernatur magni.</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'BootCard', |
||||
|
props: { |
||||
|
name: String, |
||||
|
pos: String, |
||||
|
age: Number |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
||||
|
<style scoped> |
||||
|
h3 { |
||||
|
margin: 40px 0 0; |
||||
|
} |
||||
|
ul { |
||||
|
list-style-type: none; |
||||
|
padding: 0; |
||||
|
} |
||||
|
li { |
||||
|
display: inline-block; |
||||
|
margin: 0 10px; |
||||
|
} |
||||
|
a { |
||||
|
color: #42b983; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,31 @@ |
|||||
|
<template> |
||||
|
<div class="card shadow"> |
||||
|
<div class="header bg-primary text-white"> |
||||
|
<h5>Počitadlo</h5> |
||||
|
</div> |
||||
|
<div class="card-body text-center"> |
||||
|
<h1 class="display-1 tex-primary">{{ count }}</h1> |
||||
|
<div class="btn-group mt-3"> |
||||
|
<button class="btn btn-danger" @click="count--">-1</button> |
||||
|
<button class="btn btn-secondary" @click="count = 0">reset</button> |
||||
|
<button class="btn btn-success" @click="count++">+1</button> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="count>10" class="alert alert-danger mt-3"> |
||||
|
ČÍSLO JE VĚTŠÍ NEŽ 10 |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: "EzPocitadlo", |
||||
|
data() { |
||||
|
return { |
||||
|
count:0 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
@ -0,0 +1,52 @@ |
|||||
|
<template> |
||||
|
<div class="card shadow"> |
||||
|
<div class="card-header bg-success text-white"> |
||||
|
<h5>Formulář</h5> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="mb-3"> |
||||
|
<label class="form-label">Jméno:</label> |
||||
|
<input type="text" class="form-control" |
||||
|
v-model="name" placeholder="Zadej jméno"> |
||||
|
</div> |
||||
|
<div class="mb-3"> |
||||
|
<label class="form-label">Oblíbená Barva:</label> |
||||
|
<select class="form-select" v-model="color"> |
||||
|
<option value="">---vyber---</option> |
||||
|
<option value="primary">Modrá</option> |
||||
|
<option value="success">Zelená</option> |
||||
|
<option value="danger">Červená</option> |
||||
|
<option value="warning">Žlutá</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
|
||||
|
<div v-if="name && color" :class="`alert alert-${color}`"> |
||||
|
<strong>Ahoj {{ name }}.</strong> Tvoje fav.c je {{ colorName }} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default{ |
||||
|
name:"FavForm", |
||||
|
data() { |
||||
|
return { |
||||
|
name: "", |
||||
|
color: "" |
||||
|
} |
||||
|
}, |
||||
|
computed:{ |
||||
|
colorName() { |
||||
|
const colors = { |
||||
|
"primary": "modrá", |
||||
|
"success" : "zelená", |
||||
|
"danger" : "červená", |
||||
|
"warning" : "žlutá" |
||||
|
} |
||||
|
return colors[this.color] || "" |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
Loading…
Reference in new issue