mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-10 08:41:09 +08:00
16 lines
291 B
TypeScript
16 lines
291 B
TypeScript
import { StoreDefinition, storeToRefs } from 'pinia'
|
|
|
|
/**
|
|
* 使用pinia store
|
|
* @param store
|
|
* @returns
|
|
*/
|
|
export function usePiniaStore<T extends StoreDefinition>(store: T) {
|
|
const storeVal = store()
|
|
const storeRef = storeToRefs(storeVal)
|
|
return {
|
|
...storeVal,
|
|
...storeRef,
|
|
}
|
|
}
|