Could I use pinia without installing vue?

Viewed 260

How could i use pinia without vue and vite?

 "dependencies": {
    "pinia": "^2.0.11",
    "vite": "^2.7.13",
    "vue": "^3.2.30"
  }

I try to use pinia like this:

import { createApp } from 'vue';
import { useLoginStore } from './src/index.js';
import { createPinia } from 'pinia';
const pinia = createPinia();
const app = createApp({
  data() {
    return {};
  }
});
app.use(pinia);
const useState = useLoginStore();

console.log(`<<<<01-24 08:52:27>>>>⬇️\n✨`, `useState`, useState);


and i use node to run it: node test

But it return error

Cannot find package '@vue/composition-api' imported from ...\node_modules\vue-demi\lib\index.mjs
0 Answers
Related