# vuex-ts-extension

> 基于有些浏览器不支持vuex的操作提示，此插件可智能提示各状态和方法，且支持区分namespaced配置

Latest version **0.0.3** (published 2022-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install vuex-ts-extension
pnpm add vuex-ts-extension
yarn add vuex-ts-extension
bun add vuex-ts-extension
```

## 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.3 |
| Published | 2022-12-27 |
| First published | 2022-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 315.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | danhang |
| Maintainers | danhanga |
| Keywords | ts, typescript, vuex, map |

## Links

- npm: https://www.npmjs.com/package/vuex-ts-extension
- Repository: https://github.com/cherrybiu/vuex-ts-extension
- Homepage: https://github.com/cherrybiu/vuex-ts-extension#readme
- Issues: https://github.com/cherrybiu/vuex-ts-extension/issues
- npm.io page: https://npm.io/package/vuex-ts-extension

## Dependencies (1)

- [yarn](https://npm.io/package/yarn.md) ^1.22.19

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2022-12-27
- 0.0.2 — 2022-12-27
- 0.0.1 — 2022-12-07

## README

# vuex-ts-extension
基于有些浏览器不支持vuex的操作提示，此插件可智能提示各状态和方法，且支持区分namespaced配置

### map函数导入
通常在store.js的store初始化文件中，导入该插件
![img_5.png](src/assets/img_5.png)
然后导出如下几个方法
![img_9.png](src/assets/img_9.png)

### map辅助函数使用步骤
1. 从store文件导入所需要的辅助函数
![img.png](src/assets/img.png)
2. 直接使用,支持多种vuex支持的方式
- 支持namespaced
![img_1.png](src/assets/img_1.png)
![img_2.png](src/assets/img_2.png)
![img_3.png](src/assets/img_3.png)

- 不支持namespaced
- ![img_4.png](src/assets/img_4.png)

**其他用法皆为map辅助函数的用法，不同是使用时有提示**

### 检验所定义变量类型
![img_7.png](src/assets/img_7.png)

###示例
```javascript
import Vue from "vue";
import Vuex from "vuex";
import { StoreExtension } from 'vuex-ts-extension'

Vue.use(Vuex);

const storeOptions = {
    state: {} as any,
    mutations: {} as any,
    actions: {} as any,
    modules: {
        test,
        noNamed,
    },
};

const storeInstance = new StoreExtension(storeOptions);
export const { mapState, mapGetters, mapActions, mapMutations } = storeInstance;
```

```javascript
import { mapState, mapMutations, mapActions } from "./store";

export default Vue.extend({
  name: "App",
  components: {
    HelloWorld,
  },
  computed: {
    ...mapState("test", ["isShow", "text"]),
    ...mapState(["isModule"]),
  },
  created() {
    console.log("text--", this.text);
    this.changeText("xixixi");
    console.log("textAfter---", this.text);
    console.log("isModule");

    this.changeModuleAsync("123");
  },
  methods: {
    ...mapMutations("test", ["changeText"]),
    ...mapActions(["changeModuleAsync"]),
  },
});
```

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