diff --git a/package.json b/package.json index 9a5666848..cf2cb4459 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,8 @@ "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0", + "@vuelidate/core": "^2.0.0-alpha.14", + "@vuelidate/validators": "^2.0.0-alpha.12", "axios": "^0.19.0", "babel-eslint": "^10.1.0", "chart.js": "2.7.3", diff --git a/src/assets/menu/menu.json b/src/assets/menu/menu.json index d20d07355..dfca0bc66 100644 --- a/src/assets/menu/menu.json +++ b/src/assets/menu/menu.json @@ -749,6 +749,17 @@ } ] }, + { + "name": "Validation", + "meta": ["validation"], + "children": [ + { + "name": "Vuelidate", + "to": "/vuelidate", + "badge": "New" + } + ] + }, { "name": "Misc", "meta": ["misc"], diff --git a/src/router/index.js b/src/router/index.js index c5b7aa18a..e2d828d0b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -815,6 +815,11 @@ const routes = [ path: '/galleria/advanced', name: 'galleriaadvvanced', component: () => import('../views/galleria/GalleriaAdvancedDemo.vue') + }, + { + path: '/vuelidate', + name: 'vuelidateform', + component: () => import('../views/validation/VuelidateFormDemo.vue') } ]; diff --git a/src/views/validation/VuelidateFormDemo.vue b/src/views/validation/VuelidateFormDemo.vue new file mode 100644 index 000000000..fe1e8c861 --- /dev/null +++ b/src/views/validation/VuelidateFormDemo.vue @@ -0,0 +1,563 @@ + + + + + Vuelidate + PrimeVue components can be easily used/integrated with Vuelidate. In this example, a register panel is simulated using Vuelidate. + + + + + + + + + Registration Successful! + + Your account is registered under name {{name}} ; it'll be valid next 30 days without activation. Please check {{email}} for activation instructions. + + + + + + + + + + + + Register + + + + + Name* + + {{v$.name.required.$message.replace('Value', 'Name')}} + + + + + + Email* + + + + {{error.$message}} + + + {{v$.email.required.$message.replace('Value', 'Email')}} + + + + + + Pick a password + + + {{sp.level}} + + Suggestions + + At least one lowercase + At least one uppercase + At least one numeric + Minimum 8 characters + + + + Password* + + {{v$.password.required.$message.replace('Value', 'Password')}} + + + + + Birthday + + + + + + Country + + + + + I agree to the terms and conditions* + + + + + + + + + + + + + + + \ No newline at end of file
PrimeVue components can be easily used/integrated with Vuelidate. In this example, a register panel is simulated using Vuelidate.
+ Your account is registered under name {{name}} ; it'll be valid next 30 days without activation. Please check {{email}} for activation instructions. +
Suggestions