# vuex-convert

> Simplify vuex configuration

Latest version **1.0.9** (published 2020-07-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install vuex-convert
pnpm add vuex-convert
yarn add vuex-convert
bun add vuex-convert
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2020-07-09 |
| First published | 2019-02-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Pszz |
| Maintainers | pszz |
| Keywords | Vuex, Vue |

## Links

- npm: https://www.npmjs.com/package/vuex-convert
- Repository: https://github.com/Pszz/Vuex-Convert
- Homepage: https://github.com/Pszz/Vuex-Convert#readme
- Issues: https://github.com/Pszz/Vuex-Convert/issues
- npm.io page: https://npm.io/package/vuex-convert

## Recent versions

- 1.0.9 (latest) — 2020-07-09
- 1.0.7 — 2019-06-29
- 1.0.6 — 2019-06-26
- 1.0.5 — 2019-06-13
- 1.0.4 — 2019-02-28
- 1.0.3 — 2019-02-28
- 1.0.2 — 2019-02-28
- 1.0.1 — 2019-02-27
- 1.0.0 — 2019-02-27

## README

# Vuex-Convert
### Version 1.0.2



### Description(简述)

- Simplify vuex configuration(简化Vuex配置，让你的团队更容易上手)


### Install（安装）

```base
$ npm i vuex-convert
```



### Basic usage（基本用法）

- Create store.js

```javascript
// /conf/store.js
import Vue from 'vue'
import Vuex from 'vuex'
import VuexConvert from 'vuex-convert'

const STORE = new VuexConvert({
  // State Data(状态变量)
  public:{
    base: 'Hello Vuex'
    // ...other state（其他状态）
  },
  // Modules Data(存放Modules变量)
  modules:{
    user:{
      name: 'Pi'
    }
    // ...other state（其他状态）
  }
})

Vue.use(Vuex)
export default new Vuex.Store(STORE)

```

- main.js

``` javascript
import store from './conf/store.js'
  
new Vue({
    store,  // <---- add store
    // Other content
})
```






### Use the demo （使用案例）

``` Vue
// app.vue
export default {
  name: 'App',
  mounted(){
   // get Data
   console.log(this.$store.state.base) // --> "Hello Vuex"
   console.log(this.$store.getters.getBase) // --> "Hello Vuex"
   console.log(this.$store.getters["user/getName"]) // --> "Pi"
    
    // set Data 
    this.$store.dispatch('setBase', 'Update Hello')
    console.log(this.$store.state.base) // --> "Update Hello"
  }
}

```



### Link

- [ More usage (更多用法) ](http://www.piszz.com/Vuex-Convert/docs/index.html)
- [ Source (源码) ](https://github.com/Pszz/Vuex-Convert)

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