All Projects → xaksis → Vue Good Wizard

xaksis / Vue Good Wizard

Licence: mit
An easy and clean VueJS 2.x wizard plugin

Projects that are alternatives of or similar to Vue Good Wizard

Juce
JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins.
Stars: ✭ 3,841 (+1296.73%)
Mutual labels:  plugin
Angular Archwizard
A wizard component for Angular 9+
Stars: ✭ 266 (-3.27%)
Mutual labels:  wizard
Vim Lastplace
Intelligently reopen files at your last edit position in Vim.
Stars: ✭ 271 (-1.45%)
Mutual labels:  plugin
Motrix Webextension
A chrome extension for the Motrix Download Manager
Stars: ✭ 253 (-8%)
Mutual labels:  plugin
Cordova Plugin Admob
Basic Cordova Plugin for AdMob
Stars: ✭ 263 (-4.36%)
Mutual labels:  plugin
Clangformat Xcode
Xcode plug-in to to use clang-format from in Xcode and consistently format your code with Clang
Stars: ✭ 2,852 (+937.09%)
Mutual labels:  plugin
Cathook
Training Software for the game Team Fortress 2
Stars: ✭ 256 (-6.91%)
Mutual labels:  plugin
Sketch Connection Flow Arrows
Plugin for generating easy to use connection flow arrows in Sketch
Stars: ✭ 275 (+0%)
Mutual labels:  plugin
Vim Crystalline
Functions for taking the monotony out of building your own fancy statusline in Vim
Stars: ✭ 264 (-4%)
Mutual labels:  plugin
Vst.net
Virtual Studio Technology (VST) for .NET. Plugins and Host applications.
Stars: ✭ 267 (-2.91%)
Mutual labels:  plugin
Runtimeunityeditor
In-game inspector and debugging tools for applications made with Unity3D game engine
Stars: ✭ 254 (-7.64%)
Mutual labels:  plugin
Android Mvp Mvvm Flytour
🔥🔥🔥 FlyTour是Android MVVM+MVP+Dagger2+Retrofit+RxJava+组件化+插件组成的双编码架构+双工程架构+双语言Android应用开发框架,通过不断的升级迭代该框架已经有了十个不同的版本,5.0之前工程架构采用gradle配置实现组件化,5.0之后的工程架构采用VirtualAPK实现了插件化,5.0之前采用Java编码实现,5.0之后采用Kotlin编码实现,编码架构由MVVM和MVP组成,工程架构和编码架构及编码语言开发者可根据自己具体的项目实际需求去决定选择使用,该框架是Android组件化、Android插件化、Android MVP架构、Android MVVM架构的集大成者,帮助你快速的搭建自己的App项目开发框架,以便把主要的精…
Stars: ✭ 2,948 (+972%)
Mutual labels:  plugin
Parinfer Rust
A Rust port of parinfer.
Stars: ✭ 270 (-1.82%)
Mutual labels:  plugin
Excel2unity
一个为Unity3D编写的插件,可以快速地将Excel文件转换为JSON、CSV和XML
Stars: ✭ 255 (-7.27%)
Mutual labels:  plugin
Protein
💊 Protein is an IntelliJ Plugin to generate Kotlin code for Retrofit 2 and RxJava 2 based on a Swagger definition
Stars: ✭ 273 (-0.73%)
Mutual labels:  plugin
Damnwebscanner
Another web vulnerabilities scanner, this extension works on Chrome and Opera
Stars: ✭ 254 (-7.64%)
Mutual labels:  plugin
Octoprint Enclosure
OctoPrint Enclosure Plugin
Stars: ✭ 267 (-2.91%)
Mutual labels:  plugin
Rollup Plugin Ts
A Typescript Rollup plugin that bundles declarations and respects Browserslists
Stars: ✭ 273 (-0.73%)
Mutual labels:  plugin
Merge Duplicate Symbols
Sketch plugin to merge symbols and layer&text styles.
Stars: ✭ 272 (-1.09%)
Mutual labels:  plugin
Cordova Httpd
Embed tiny web server into Cordova with a plugin
Stars: ✭ 271 (-1.45%)
Mutual labels:  plugin

vue-good-wizard

npm npm npm

An easy and clean VueJS 2.x wizard plugin

Basic Screenshot

Live Demo

vue-good-wizard Demo

Buy Me A Coffee

Follow the project progress live

Vue-good-wizard Project

Getting Started

Installing

Install with npm:

npm install --save vue-good-wizard

import into project:

import Vue from 'vue';
import VueGoodWizard from 'vue-good-wizard';

Vue.use(VueGoodWizard);

or

import into component:

// within your component script tag
import { GoodWizard } from 'vue-good-wizard';

// in your components
components: {
  'vue-good-wizard': GoodWizard,
}

Example Usage

<template>
  <div>
    <vue-good-wizard 
      :steps="steps"
      :onNext="nextClicked" 
      :onBack="backClicked">
      <div slot="page1">
        <h4>Step 1</h4>
        <p>This is step 1</p>
      </div>
      <div slot="page2">
        <h4>Step 2</h4>
        <p>This is step 2</p>
      </div>
      <div slot="page3">
        <h4>Step 3</h4>
        <p>This is step 3</p>
      </div>
      <div slot="page4">
        <h4>Step 4</h4>
        <p>This is step 4</p>
      </div>
    </vue-good-wizard>
  </div>
</template>

<script>
export default {
  name: 'demo',
  data(){
    return {
      steps: [
        {
          label: 'Select Items',
          slot: 'page1',
        },
        {
          label: 'Add Constraints',
          slot: 'page2',
        },
        {
          label: 'Review',
          slot: 'page3',
        },
        {
          label: 'Apply',
          slot: 'page4',
          options: {
            nextDisabled: true, // control whether next is disabled or not
          },
        }
      ],
    };
  },
  methods: {
    nextClicked(currentPage) {
      console.log('next clicked', currentPage)
      return true; //return false if you want to prevent moving to next page
    },
    backClicked(currentPage) {
      console.log('back clicked', currentPage);
      return true; //return false if you want to prevent moving to previous page
    }
  },
};
</script>

This should result in the screenshot seen above

Component Options

Option Description Type, Example
steps (required) Array of objects that specify step titles and page id
[
  {
    label: 'Add Constraints', // title for wizard step
    page: 'page2', //id for div to show for this step
  },
  //...
]
onNext (optional) function called before next page is shown. This is a good place to do validation etc. Return true to proceed, or false to stay on the same page. function ex:
function(currentPage){
  console.log(currentPage);
  return true;
}
onBack (optional) function called before previous page is shown. Return true to proceed, or false to stay on the same page. function ex:
function(currentPage){
  console.log(currentPage);
  return true;
}
Label options
previousStepLabel label for previous step default: 'Back'
nextStepLabel label for next step default: 'Next'
finalStepLabel label for final step default: 'Save'
Useful internal functions
goNext() for async usecase, you'd want to go next only after your async function is done. See [advanced usecase](https://github.com/xaksis/vue-good-wizard#advanced-usecase---call-next-or-back-asynchronously) `this.$refs['my-wizard'].goNext(true)`
goTo(step) if you want to go to a step programmatically, you can use this method `this.$refs['my-wizard'].goTo(2)` // go to 3rd step.

Advanced usecase - Call next or back asynchronously

In some cases, you might want to change step programmatically. The most common usecase for this is if you want to call an asynchronous action on next/back click and then in the callback want to either go to the next step or stay on the same step.

Following is an example of how this can be done using vue-good-wizard

<template>
  <div>
    <vue-good-wizard 
      ref="wizard"
      :steps="steps"
      :onNext="nextClicked" 
      :onBack="backClicked">
      <div slot="page1">
        <h4>Step 1</h4>
        <p>This is step 1</p>
      </div>
      <div slot="page2">
        <h4>Step 2</h4>
        <!-- lets say, this is where my form is that needs to be validated -->
        <el-form :model="myForm" ref="myForm">
        </el-form>
      </div>
      <div slot="page3">
        <h4>Step 3</h4>
        <p>This is step 3</p>
      </div>
    </vue-good-wizard>
  </div>
</template>

<script>
export default {
  name: 'demo',
  data(){
    return {
      steps: [
        {
          label: 'Select Items',
          slot: 'page1',
        },
        {
          label: 'My form',
          slot: 'page2',
        },
        {
          label: 'Review',
          slot: 'page3',
        },
      ],
    };
  },
  methods: {
    nextClicked(currentPage) {
      const _this = this;

      // if we're on the form page
      if (currentPage == 1) {

        // on next, we need to validate the form
        _this.$refs.myForm.validate((valid) => {
          if (valid) {

            //all is good, lets proceed to next step
            _this.$refs.wizard.goNext(true);
          } else {

            //error. don't proceed.
            console.log('error submit!!');
            return false;
          }
        });
        return false; //don't proceed by default. 
      }
      return true; //return false if you want to prevent moving to next page
    },
    backClicked(currentPage) {
      console.log('back clicked', currentPage);
      return true; //return false if you want to prevent moving to previous page
    }
  },
};
</script>

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].