# Getting Started

# Install with NPM or Yarn

$ npm i vue-routisan@next
$ # or yarn add vue-routisan@next

# Upgrading from v2

v3 contains breaking changes.

Please see the upgrade guide (opens new window) and changelog (opens new window) for more information.

# The Scaffold

Made up of two primary components, Route and Factory, Routisan is really easy to use. Simply declare your routes and add them to the Vue Router instance:

# Vue Router < 4

import Router from 'vue-router'
import { Route, Factory } from 'vue-routisan'

import Home from './pages/Home.vue'

// Define your routes…
Route.view('/', Home)

// Export a new router with Routisan’s routes applied.
export const router = new Router({
  mode: 'history', // or createWebHistory() in Vue Router 4
  routes: Factory.routes()
})

# Vue Router > 4

import { createRouter, createWebHistory } from 'vue-router'
import { Route, Factory } from 'vue-routisan'

import Home from './pages/Home.vue'

// Define your routes…
Route.view('/', Home)

// Export a new router with Routisan’s routes applied.
export const router = createRouter({
  mode: createWebHistory(),
  routes: Factory.routes()
})
Last Updated: 9/26/2021, 4:54:48 AM