chore: update fixture
This commit is contained in:
17
fixtures/vitesse/src/modules/pinia.ts
Normal file
17
fixtures/vitesse/src/modules/pinia.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { createPinia } from 'pinia'
|
||||
import { type UserModule } from '~/types'
|
||||
|
||||
// Setup Pinia
|
||||
// https://pinia.vuejs.org/
|
||||
export const install: UserModule = ({ isClient, initialState, app }) => {
|
||||
const pinia = createPinia()
|
||||
app.use(pinia)
|
||||
// Refer to
|
||||
// https://github.com/antfu/vite-ssg/blob/main/README.md#state-serialization
|
||||
// for other serialization strategies.
|
||||
if (isClient)
|
||||
pinia.state.value = (initialState.pinia) || {}
|
||||
|
||||
else
|
||||
initialState.pinia = pinia.state.value
|
||||
}
|
Reference in New Issue
Block a user