# lj-pinia

> pinia的简单版本 vue3

Latest version **0.1.0** (published 2024-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install lj-pinia
pnpm add lj-pinia
yarn add lj-pinia
bun add lj-pinia
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2024-01-09 |
| First published | 2024-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | liujian |
| Maintainers | liujian522 |
| Keywords | vue, vuex, store, pinia, piña, pigna, composition, api, setup, typed, typescript, ts, type, safe |

## Links

- npm: https://www.npmjs.com/package/lj-pinia
- Repository: https://gitee.com/jian-liu-one/lj-pinia
- Homepage: https://gitee.com/jian-liu-one/lj-pinia/blob/master/README.md
- npm.io page: https://npm.io/package/lj-pinia

## 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.1.0 (latest) — 2024-01-09
- 0.0.9 — 2024-01-09
- 0.0.8 — 2024-01-09
- 0.0.7 — 2024-01-09
- 0.0.6 — 2024-01-09
- 0.0.5 — 2024-01-09
- 0.0.4 — 2024-01-09
- 0.0.3 — 2024-01-09
- 0.0.2 — 2024-01-09
- 0.0.1 — 2024-01-09

## README

# lj-pinia

> 项目包含 defineStore 和 createPinia方法

这是官方版本地址 [its documentation](https://pinia.vuejs.org/zh/) pinia

## License

[MIT](http://opensource.org/licenses/MIT)


#### 介绍
一个简单的pinia状态管理机，使用简单，只有几K大小。

#### 软件架构
采用Vue3 + Ts 完成

#### 安装教程

1. 安装 `npm i lj-pinia`

#### 使用说明

```
import { createApp, Plugin } from 'vue'
import { createPinia } from 'lj-pinia'
import App from './App.vue'
const pinia = createPinia()
const app = createApp(App)
//不可省略
app.use(pinia as Plugin<[]>)
app.mount('#app')
```

```
//创建仓库示例
export const useStore = defineStore('storeId', {
    state: () => ({ count: 1 }),
    getters: {
        double: (state: { count: 0 }) => {
            return state.count * 2
        },
    },
    actions: {
        increment() {
            this.count++
        },
    },
})
```

```
<script setup lang="ts">
import { useCounterStore } from './store';
const store = useCounterStore()
</script>
<template>
  <button @click="() => {
    store.increment()
  }">
  {{ store.count }}
  </button>
  <div>
    {{ store.double }}
  </div>
</template>
```

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