├── .browserslistrc
├── .eslintrc.js
├── .gitignore
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── favicon.ico
├── images
│ ├── multi-step form demo.png
│ └── vue-multi-step-form.gif
└── index.html
└── src
├── App.vue
├── assets
└── logo.png
├── components
├── FormWizard.vue
├── HelloWorld.vue
└── Tab.vue
└── main.js
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | 'extends': [
7 | 'plugin:vue/essential',
8 | 'eslint:recommended'
9 | ],
10 | rules: {
11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13 | },
14 | parserOptions: {
15 | parser: 'babel-eslint'
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | #/dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # VueJS Simple Form Wizard
2 | Simple Implementation of Multi Step Form with Validation in Vue
3 |
4 | 
5 |
6 | ### Template
7 |
8 | This is how you can declare a multistep form template in your HTML
9 |
10 | ```html
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ```
23 |
24 |
25 | ### Form Fields
26 |
27 | Here is an example declaration of form-field inside the tab component
28 |
29 | ```html
30 |
31 |
32 |
33 |
34 |
35 | {{ errors.first('step1.fullname') }}
36 |
37 |
38 |
39 | ```
40 |
41 | I am using bulma component and hence some styling classes refer to that. You can use any design framework.
42 |
43 | **data-vv-scope** : This is for vee-validate validation, and this defines the step that this tab belongs to. (use step1, step2 etc.)
44 |
45 | **data-validation** : Add validation rules as per your requirement.
46 |
47 | ## Demo
48 |
49 | [Working Demo](https://tushargugnani.github.io/vue-simple-form-wizard/)
50 |
51 | ### Code Explanation
52 |
53 | I have written a code explanation on my blog [VueJS Multi-Step Form Wizard](https://www.5balloons.info/simple-multi-step-form-wizard-with-validation-in-vuejs/)
54 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form-wizard-vue-simple",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "bulma": "^0.7.4",
12 | "bulma-steps-component": "^0.5.3",
13 | "core-js": "^2.6.5",
14 | "vee-validate": "^2.2.6",
15 | "vue": "^2.6.10"
16 | },
17 | "devDependencies": {
18 | "@vue/cli-plugin-babel": "^3.7.0",
19 | "@vue/cli-plugin-eslint": "^3.7.0",
20 | "@vue/cli-service": "^3.7.0",
21 | "babel-eslint": "^10.0.1",
22 | "eslint": "^5.16.0",
23 | "eslint-plugin-vue": "^5.0.0",
24 | "sass": "^1.18.0",
25 | "sass-loader": "^7.1.0",
26 | "vue-template-compiler": "^2.5.21"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tushargugnani/vue-simple-form-wizard/158705d78d54cbe1e09d11026e2751bd3efbede1/public/favicon.ico
--------------------------------------------------------------------------------
/public/images/multi-step form demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tushargugnani/vue-simple-form-wizard/158705d78d54cbe1e09d11026e2751bd3efbede1/public/images/multi-step form demo.png
--------------------------------------------------------------------------------
/public/images/vue-multi-step-form.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tushargugnani/vue-simple-form-wizard/158705d78d54cbe1e09d11026e2751bd3efbede1/public/images/vue-multi-step-form.gif
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | form-wizard-vue-simple
9 |
10 |
11 |
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
27 |
28 |
29 |
56 |
57 |
58 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
110 |
111 |
122 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tushargugnani/vue-simple-form-wizard/158705d78d54cbe1e09d11026e2751bd3efbede1/src/assets/logo.png
--------------------------------------------------------------------------------
/src/components/FormWizard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
{{tab.name}}
8 |
{{tab.info}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
8 |
9 |
Installed CLI Plugins
10 |
14 |
Essential Links
15 |
22 |
Ecosystem
23 |
30 |
31 |
32 |
33 |
41 |
42 |
43 |
59 |
--------------------------------------------------------------------------------
/src/components/Tab.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | new Vue({
7 | render: h => h(App),
8 | }).$mount('#app')
9 |
--------------------------------------------------------------------------------