From e6f5ea176228eb2a34cd1988f674f3732d42a8b6 Mon Sep 17 00:00:00 2001 From: Ferriel Melarpis Date: Tue, 13 Feb 2018 12:02:49 +0800 Subject: [PATCH] Delta-124 Freedom.tm > Revamp > Frontend > Implement User Profile Page (#16) Make usage of FormField component easier - Simpler configuration object - Took advantage of v-model resolution to `:value - @input` - Updated form template - Updated WIKI for component and template usage Approved by: - @JonelRempis (jonel.rempis@freedom.tm) - @wilbertverayin (wilbert.verayin@freedom.tm) --- src/components/partials/form/FormField.vue | 39 ++++++++-------------- src/router.js | 5 ++- templates/form.vue | 18 ++++------ 3 files changed, 23 insertions(+), 39 deletions(-) diff --git a/src/components/partials/form/FormField.vue b/src/components/partials/form/FormField.vue index 6b2927f..d818f1e 100644 --- a/src/components/partials/form/FormField.vue +++ b/src/components/partials/form/FormField.vue @@ -1,12 +1,11 @@ diff --git a/src/router.js b/src/router.js index 29ed6df..a750242 100644 --- a/src/router.js +++ b/src/router.js @@ -7,10 +7,10 @@ Vue.use(VueRouter); * Uncomment this section and use "load()" if you want * to lazy load routes. */ -function load (component) { +/* function load (component) { // '@' is aliased to src/components return () => import(`@/${component}.vue`) -} +} */ export default new VueRouter({ /* @@ -26,6 +26,5 @@ export default new VueRouter({ */ routes: [ - { path: '/', component: load('TestForm') } ] }); diff --git a/templates/form.vue b/templates/form.vue index 9962e78..65baccd 100644 --- a/templates/form.vue +++ b/templates/form.vue @@ -3,10 +3,8 @@ @@ -25,13 +23,11 @@ return { form: [ { - type: 'input', - model: null, - validation: {}, - config: { - fieldProps: {}, - fieldInputProps: {} - }, + type: 'input', // will resolve to `q-${type}` + value: null, // initial value of model + validation: {}, // input validation using Vuelidate + field: {}, // QField properties + fieldInput: {} // `q-${type}` properties } ] };