# vuex-plugins-clear

> vuex-plugin-clear

Latest version **0.0.7** (published 2019-09-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install vuex-plugins-clear
pnpm add vuex-plugins-clear
yarn add vuex-plugins-clear
bun add vuex-plugins-clear
```

## 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.0.7 |
| Published | 2019-09-25 |
| First published | 2019-09-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangjunfad@163.com |
| Maintainers | wangjunfa |
| Keywords | ISC |

## Links

- npm: https://www.npmjs.com/package/vuex-plugins-clear
- Repository: https://github.com/wangdadada/vuex-clear-plugin
- Homepage: https://github.com/wangdadada/vuex-clear-plugin#readme
- Issues: https://github.com/wangdadada/vuex-clear-plugin/issues
- npm.io page: https://npm.io/package/vuex-plugins-clear

## Recent versions

- 0.0.7 (latest) — 2019-09-25
- 0.0.6 — 2019-09-25

## README

# vuex-plugin-clear

> vuex-plugin-clear 是一个使用 vuex 技术栈，可以自动清除 vuex module 层数据的插件

## Features

自动清除 vuex module 层数据，
平时写业务代码的时候，
有可能会出现忘记清除 module 层数据情况，使用 vuex-plugin-clear 可以有效避免这种情况的发生

## Getting started

### Installation

```

npm install vuex-plugin-clear
```

### Example

```javascript
const modules = {
  color,
  count
};
import initData from "vuex-plugin-clear";
const moduleControl = initData(modules);
export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  plugins: [moduleControl],
});
```

## Usage

### 清除所有 module 数据

```javascript
vm.$store.commit("initDataAll");
```

### 清除指定 vuex module 数据

```javascript
const modules = ["count", "color"];
vm.$store.commit("initDataAll", modules);
```

```javascript
这样就能清除 count 和 color module的数据
```

### 清除指定 vuex 模块不清除

```javascript
const modules = ["count", "color"];
vm.$store.commit("initDtaAllExpect", modules);
```

```javascript
这样就能清除 除 count 和 color module的数据
```

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