Getting Started

This documentation is meant for beginner. If you already know how to set up a Vue 3 Project, please skip to this section

Set up Vue 3 Project

Vue CLI

npm install -g @vue/cli
vue create my-app

cd my-app
code .

Vite JS

WARNING

Vite requires Node.js version >=12.0.0.

npm init vite@latest my-app --template vue

cd my-app && npm install
code .

Installation

We are going to use Vue 3 throughout this documentation. If you are still using Vue 2, feel free to check the official documentation.

Install pinia

npm install pinia@next

Create pinia root store

Remember we talked about that pinia can define multiple stores? This happen because we create a pinia root store at pass it to our app instance, then all we have to do is to define it any amount you like.

// import { createApp } from 'vue';
// import App from './App.vue';
import { createPinia } from 'pinia';

// const app = createApp(App);
app.use(createPinia()); 

// app.mount('#app');

That's it! You successfully create a pinia store! 🎉