From 54acf1efc5174bc21c20c70494e46fafee93481e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 8 Mar 2019 20:20:19 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 2 ++ ayanova/src/main.js | 10 ++++++ ayanova/src/views/inventory-widget-edit.vue | 35 +++++++++++++++++---- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 52a8a7d0..0ce61fec 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -18,6 +18,8 @@ TODO NEXT DATETIME - Does it validate properly? NO. Get validation working!! + - So it looks like it will need a custom validator as it completely barfs on my string date format coming from the server + - https://baianat.github.io/vee-validate/guide/custom-rules.html#creating-a-custom-rule - https://baianat.github.io/vee-validate/concepts/components.html#how-it-works - possibly helpful https://stackoverflow.com/questions/47982820/vuejs-vee-validate-in-custom-components - or https://duckduckgo.com/?q=vee+validate+with+custom+component&t=ffab&atb=v134-6__&ia=web diff --git a/ayanova/src/main.js b/ayanova/src/main.js index d50bcaad..3b5f1f99 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -33,6 +33,16 @@ Object.defineProperty(Vue.prototype, "$gzerror", { // FORM VALIDATION // import VeeValidate from "vee-validate"; +//My custom rules +import gzaftervalidator from "./api/gzaftervalidator"; +VeeValidate.Validator.extend("gzafter", gzaftervalidator); +// VeeValidate.Validator.extend( +// gzaftervalidator, +// Rules[gzaftervalidator].validate, +// assign({}, Rules[gzaftervalidator].options, { +// paramNames: Rules[gzaftervalidator].paramNames +// }) +// ); Vue.use(VeeValidate); //Vue.config.productionTip = false; diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 311a4781..d3844edc 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -50,12 +50,37 @@ + + + + + + + +