Skip to content

How to initialise a store, pre vue build #512

Discussion options

You must be logged in to vote

You can do

const app = createApp({
  setup() {
    const store = useGlobalStore()
    store.userInit()
  }
})

this is equivalent to what you were doing in Vuex:

const app = createApp({ created() { this.$store.dispatch("userinit"); } })

Replies: 1 comment 1 reply

Comment options

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

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants