You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vue3 Form Wizard now supports automatic route synchronization with Vue Router!
Setup
First, install Vue Router:
npm install vue-router@4.1.6
Configure your Vue app with Vue Router:
import{createApp}from'vue'import{createRouter,createWebHistory}from'vue-router'importAppfrom'./App.vue'constrouter=createRouter({history: createWebHistory(),routes: [// Your routes]})constapp=createApp(App)app.use(router)app.mount('#app')
Usage
Add route prop to your tab-content components:
<template>
<form-wizard@on-complete="onComplete"color="#9b59b6">
<tab-contenttitle="Step 1"route="/step1">
Content for step 1
</tab-content>
<tab-contenttitle="Step 2"route="/step2">
Content for step 2
</tab-content>
<tab-contenttitle="Step 3"route="/step3">
Content for step 3
</tab-content>
</form-wizard>
</template>
Features
β Automatic Navigation: Tab changes update the URL
β URL Sync: Direct URL access navigates to the correct tab
β Browser History: Back/forward buttons work correctly
β Deep Linking: Shareable URLs for specific wizard steps
Route Types
The route prop accepts:
String: route="/step1" - Direct path
Object: route="{ name: 'step1', params: { id: 1 } }" - Named routes with params
Testing Router Functionality
A router test script is included to verify your setup:
# Run the router test
node test-router.js
The test will check:
β Vue Router installation
β Router configuration
β Route definitions
β Component integration
Demo
The project includes a complete demo with router integration. Run:
npm run dev
Then visit https://localhost:5173 to see:
RouterTest component showing current route
Navigation buttons for testing
Route history tracking
Automatic URL updates when switching tabs
Until the version is completely stable
Updated To Vue3 β
Setup with Vite β
Add declaration type(Typescript Support)β
Fix All Issue on vue-form-wizard π§
Rewrite With Setup Function and ts β
Setup New Featuresπ§
Setup New Documentation β
This is a cloned package from vue-form-wizard.Updated to vue 3 with new features and bug fixes