Skip to content

Commit

Permalink
Update formmode to handle types
Browse files Browse the repository at this point in the history
  • Loading branch information
wallslide committed Jul 2, 2020
1 parent 5f1b4e6 commit 6d66f22
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/.vuepress/components/FormMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
:upil="upil"
:isMissingValue.sync="isMissingValue"
:initializingUpil.sync="initializingUpil"
:types="types"
/>
</v-sheet>
</v-expansion-panel-content>
Expand All @@ -31,6 +32,16 @@
<script>
import { UPILCore } from "@appsocially/userpil-core";
import { FormMode } from "@appsocially/vue-upil";
import { email } from "vee-validate/dist/rules";
const emailValidationRules = [
value => (value && value.length > 0 ? true : "Required"),
value => (email.validate(value) ? true : "Invalid email address")
];
const types = {
email: emailValidationRules
};
export default {
name: "FormMode",
Expand All @@ -54,7 +65,8 @@ export default {
upil: null,
panel: null,
hasRun: false,
isReady: false
isReady: false,
types
};
},
computed: {
Expand Down

0 comments on commit 6d66f22

Please sign in to comment.