phpjavac / composition

vue3 compositionApis
https://phpjavac.github.io/composition/
12 stars 11 forks source link

[feat]: useGlobalStore #75

Closed yinzhenyu-su closed 2 years ago

yinzhenyu-su commented 2 years ago

使用场景

新特性使用场景

一个简单的全局单例仓库

类型

新功能 (在原有的功能上拓展新功能)

参数、回调或其他补充

const store = useGlobalStore({ count: 0 })

const store2 = useGlobalStore()

store === store2 // true