Skip to content

bloody-ux/react-vue-router-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[![npm][npm]][npm-url] [![node][node]][node-url] [![license][license]][license-url]

react-vue-router-sync

Sync location between React Router and Vue Router

Install

npm install --save react-vue-router-sync

Usage

The react-vue-router-sync is used to sync between router status for micro frontend apps.

import sync from 'react-vue-router-sync';
import { createBrowserHistory } from 'history';
import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);
const vueRouter = new VueRouter({
  // ...
});

const history = createBrowserHistory({
  // ...
});

const unsync = sync(history, vueRouter);
history.push('/foo/bar');

console.log(vueRouter.currentRoute.fullPath); //  => /foo/bar
unsync(); // dispose sync

About

sync between react router and vue router

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published