# vue-router-sync

> Keep vm data and router state in sync.

Latest version **0.1.0** (published 2017-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-router-sync
pnpm add vue-router-sync
yarn add vue-router-sync
bun add vue-router-sync
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-11-26 |
| First published | 2017-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | EGOIST |
| Maintainers | rem |

## Links

- npm: https://www.npmjs.com/package/vue-router-sync
- Repository: https://github.com/egoist/vue-router-sync
- Homepage: https://github.com/egoist/vue-router-sync#readme
- Issues: https://github.com/egoist/vue-router-sync/issues
- npm.io page: https://npm.io/package/vue-router-sync

## Recent versions

- 0.1.0 (latest) — 2017-11-26

## README

# vue-router-sync

[![NPM version](https://img.shields.io/npm/v/vue-router-sync.svg?style=flat)](https://npmjs.com/package/vue-router-sync) [![NPM downloads](https://img.shields.io/npm/dm/vue-router-sync.svg?style=flat)](https://npmjs.com/package/vue-router-sync) [![CircleCI](https://circleci.com/gh/egoist/vue-router-sync/tree/master.svg?style=shield)](https://circleci.com/gh/egoist/vue-router-sync/tree/master)

Keep vm data and router state in sync.

## Install

```bash
yarn add vue-router-sync
```

CDN: [UNPKG](https://unpkg.com/vue-router-sync/) | [jsDelivr](https://cdn.jsdelivr.net/npm/vue-router-sync/) (available as `window.RouterSync`)

## Usage

Note that this is supposed to work with `vue-router`:

```js
import Vue from 'vue'
import RouterSync from 'vue-router-sync'

Vue.use(RouterSync)
```

Then in your component

```vue
<script>
export default {
  data() {
    return {
      foo: 'foo'
    }
  },
  syncDataRouter: {
    foo: 'foo_in_query'
  }
}
</script>
```

Mount the app and the URL will be updated to `/?foo_in_query=foo`. Everytime the `foo` is changed the corresponding URL query will be updated too.

## License

MIT &copy; [EGOIST](https://github.com/egoist)

---
_Source: https://npm.io/package/vue-router-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
