Skip to content

Vue2-vite optionsAPI not working #1019

Discussion options

You must be logged in to vote

Solved.
Basically, you need to import compositionAPI and use it to start the app much like Vue3

import VueCompositionAPI, { createApp, h } from '@vue/composition-api'
import { createPinia, PiniaVuePlugin } from 'pinia'

import App from './App.vue'
import router from './router'

Vue.use(VueCompositionAPI)

const app = createApp({
  router,
  pinia: createPinia(),
  render: () => h(App)
})
app.use(PiniaVuePlugin)

app.mount('#app')

This small key part is not written in the pinia documentation.
Should be added to pinia docs.
Funny how a discussion has stalled this long.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by R0N1n-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #1017 on February 01, 2022 12:05.