Last active
December 3, 2019 06:35
-
-
Save SanjayBoricha/de5ae955c1ff9b21b83367d73e236bec to your computer and use it in GitHub Desktop.
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="flex items-center mb-1 max-w-lg"> | |
<div class="flex-1 hidden md:block"> | |
<span>E-mail</span> | |
</div> | |
<div class="flex-1"> | |
<input | |
class="appearance-none border-b border-r rounded w-full p-2 placeholder-themeGray-200 text-themeGray-400 leading-tight focus:outline-none focus:bg-white rounded-tr-none rounded-bl-none" | |
type="email" | |
placeholder="E-mail" | |
v-model="emailAddress" | |
:class="(!$v.emailAddress.required && $v.emailAddress.$dirty) || (!$v.emailAddress.email && $v.emailAddress.$dirty) ?'border-red-500 focus:border-red-500':'border-themeGray-200 focus:border-themeGray-400'" | |
/> | |
<client-only> | |
<div class="text-red-600 text-xs"> | |
<div | |
v-if="!$v.emailAddress.required && $v.emailAddress.$dirty" | |
class="mt-2" | |
>*required</div> | |
<div | |
v-if="!$v.emailAddress.email && $v.emailAddress.$dirty" | |
class="mt-2" | |
>Should be valid email</div> | |
</div> | |
</client-only> | |
</div> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment