Skip to content

is it possible to fill pinia in server-side on nuxt 3? #947

Closed Answered by ghost
ghost asked this question in Help and Questions
Discussion options

You must be logged in to vote

my bad

import { defineNuxtPlugin } from '#app'
import { useTodos } from '@/store/todos'

export default defineNuxtPlugin(async (nuxtApp) => {
  const todos = useTodos(nuxtApp.$pinia)

  await todos.fetch()
})

Replies: 7 comments 15 replies

Comment options

You must be logged in to vote
12 replies
@abdinurkz
Comment options

@doantu05150
Comment options

@alfianriv
Comment options

@bastianjoel
Comment options

@YadBro
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@briansackett
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@SuperIbm
Comment options

@MuhammadM1998
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment