2
0
mirror of https://github.com/tenrok/vue-form-wizard.git synced 2026-05-22 11:34:03 +03:00
2017-04-16 18:30:13 +03:00
2017-04-16 18:18:15 +03:00
2017-04-16 18:18:15 +03:00
2017-04-16 13:06:20 +03:00
2017-04-16 13:05:09 +03:00
2017-04-16 12:59:43 +03:00
2017-04-16 13:01:16 +03:00
2017-04-16 18:30:13 +03:00

WIP vue-tab-wizard

A dynamic tab wizard to split your forms easier

Forms are hard to handle especially if you have a lot of fields. A page often looks very ugly when it has a ton of form fields. There are many tab wizards out there in the wild, but most of them are jQuery based and once you have a lot of tabs, they are hard to manage/modify or customize in an easy declarative way. Vue-tab-wizard is a simple component which simplifies your tab wizard and lets you focus on the functional part of your app rather than wasting time on details. Just forget about id's, external scripts and jQuery dependencies

Demo

Refer to this fiddle

Note: For now vue-tab-wizard requires bootstrap to look as it should. Also vue-tab-wizard works with themify-icons (WIP)

Usage

<tab-wizard>
  <tab-content title="Personal details">
    My first tab content
  </tab-content>
  <tab-content title="Additional Info">
      My second tab content
   </tab-content>
   <tab-content title="Last step">
     Yuhuuu! This seems pretty damn simple
   </tab-content>
</tab-wizard>

Props

Tab Wizard props

props: {
  title: {
    type: String,
    default: 'Awesome Wizard'
  },
  subtitle: {
    type: String,
    default: 'Split a complicated flow in multiple steps'
  },
  nextButtonText: {
    type: String,
    default: 'Next'
  },
  backButtonText: {
    type: String,
    default: 'Back'
  },
  finishButtonText: {
    type: String,
    default: 'Finish'
  },
  color: {
    type: String,
    default: '#e74c3c' //circle, border and text color
  },
  transition: {
    type: String,
    default: '' //name of the transition when transition between steps 
  },
  startIndex: {
    type: Number,
    default: 0 //the index of the initial tab that you want to be active
  }
}

Tab content props

props: {
  title: {
    type: String,
    default: ''
  },
  icon: {
    type: String,
    default: '' //name of the icon. Supports themify icons only for now
  },
  beforeChange: {
    type: Function  //function to execute before changing tabs. Has to return true or false. If returns false, tab change is restricted
  }
}

Slots

  • Default - Used for tab-contents
  • title - Upper title section including sub-title
  • prev - Previous button content (no need to worry about handling the button functionality)
  • next - Next button content
  • finish - Finish button content
S
Description
No description provided
Readme 1.2 MiB
Languages
Vue 51.5%
JavaScript 32.4%
CSS 13.1%
TypeScript 2.7%
HTML 0.3%