This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="panel"> | |
<div class="header"> | |
<h2 class="headline">{{ headline }}</h2> | |
</div> | |
<div class="body"> | |
<slot /> | |
</div> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
export default { | |
name: "Panel", | |
props: { | |
headline: String, | |
} | |
}; | |
</script> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="input-wrapper"> | |
<label>{{label}}</label> | |
<input | |
class="input" | |
v-if="type==='input'" | |
@input="customInput($event.target.value)" | |
autocomplete="off" | |
type="text" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<Panel class="calculator-panel" headline="Income Tax Calculator"> | |
<template> | |
<span>content goes here.<span/> | |
</template> | |
</Panel> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { Validator } from "vee-validate"; | |
const validator = new Validator(); | |
... | |
data() { | |
return { | |
validationError: "" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import VeeValidate from "vee-validate"; | |
Vue.use(VeeValidate); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
... | |
<transition name="alert-in" | |
enter-active-class="animated flipInX" | |
leave-active-class="animated flipOutX"> | |
<p v-if="validationError" class="alert" > | |
{{ validationError }} | |
</p> | |
</transition> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
... | |
<v-select | |
v-if="type ==='dropdown'" | |
class="input-dropdown" | |
@input="customInput" | |
:options="options" | |
/> | |
</template> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div | |
v-if="type ==='radio'" | |
v-for='option in options' | |
:key='option.label' | |
> | |
<input | |
type="radio" | |
class="radio" | |
:id="option.label" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<form @submit.prevent="handleSubmit"> | |
... | |
<button | |
class='submit-btn' | |
:disabled="!isEnabled" | |
type="submit" | |
> | |
Calculate! | |
</button> |
OlderNewer