Skip to content

Instantly share code, notes, and snippets.

View hinsencamp's full-sized avatar

Fabian Hinsenkamp hinsencamp

View GitHub Profile
<template>
<div class="panel">
<div class="header">
<h2 class="headline">{{ headline }}</h2>
</div>
<div class="body">
<slot />
</div>
</div>
</template>
<script>
export default {
name: "Panel",
props: {
headline: String,
}
};
</script>
<template>
<div class="input-wrapper">
<label>{{label}}</label>
<input
class="input"
v-if="type==='input'"
@input="customInput($event.target.value)"
autocomplete="off"
type="text"
>
<template>
<Panel class="calculator-panel" headline="Income Tax Calculator">
<template>
<span>content goes here.<span/>
</template>
</Panel>
</template>
<script>
import { Validator } from "vee-validate";
const validator = new Validator();
...
data() {
return {
validationError: ""
};
import VeeValidate from "vee-validate";
Vue.use(VeeValidate);
<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>
<template>
...
<v-select
v-if="type ==='dropdown'"
class="input-dropdown"
@input="customInput"
:options="options"
/>
</template>
<script>
<template>
<div
v-if="type ==='radio'"
v-for='option in options'
:key='option.label'
>
<input
type="radio"
class="radio"
:id="option.label"
<template>
<form @submit.prevent="handleSubmit">
...
<button
class='submit-btn'
:disabled="!isEnabled"
type="submit"
>
Calculate!
</button>