22 lines
486 B
Markdown
22 lines
486 B
Markdown
# counter.ts (Store)
|
||
|
||
**路径**:`src/stores/counter.ts`
|
||
|
||
## 功能用途
|
||
|
||
示例 Pinia Store,用于演示 setup 写法:`count`、`doubleCount`、`increment`。项目中可能仅用于测试或示例,业务可忽略。
|
||
|
||
## 使用方式
|
||
|
||
```typescript
|
||
import { useCounterStore } from '@/stores/counter'
|
||
|
||
const counter = useCounterStore()
|
||
counter.increment()
|
||
console.log(counter.doubleCount)
|
||
```
|
||
|
||
## 扩展方式
|
||
|
||
可删除或改为业务相关 demo(如示例数据 store)。
|