react-vue-router-sync
v0.6.1
Published
sync location between React Router and Vue Router
Downloads
16
Maintainers
Readme
[![npm][npm]][npm-url] [![node][node]][node-url] [![license][license]][license-url]
npm install --save react-vue-router-sync
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