Nuxt + Pinia
The official Vue store, using setup-store syntax. This page shows exactly what pickstack adds to a Nuxt project for Pinia: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.
$ npm create pickstack@latest my-app -- --framework nuxt --modules pinia --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
@pinia/nuxt | ^1.0.3 | runtime |
@vue/devtools-api | ^8.2.1 | runtime |
pinia | ^4.1.0 | runtime |
New files
import { defineStore } from "pinia";
import { ref } from "vue";
export const useCounterStore = defineStore("counter", () => {
const count = ref(0);
function increment() {
count.value++;
}
function decrement() {
count.value--;
}
return { count, increment, decrement };
});
Changes to existing files
<script setup lang="ts">+import { useCounterStore } from "~/stores/counter";−import { ref } from "vue"; +const counter = useCounterStore();−const count = ref(0); </script> <template> <div class="card">+ <p class="count">{{ counter.count }}</p>− <p class="count">{{ count }}</p> <div class="row">+ <button type="button" class="btn" @click="counter.decrement()">-1</button>+ <button type="button" class="btn" @click="counter.increment()">+1</button>− <button type="button" class="btn" @click="count--">-1</button>− <button type="button" class="btn" @click="count++">+1</button> </div> </div> </template>⋯ 1 unchanged lines
<template> <section class="page"> <h1 class="title">About</h1>+ <p class="text">Built with Nuxt 4, Vue 3, TypeScript, Pinia.</p>− <p class="text">Built with Nuxt 4, Vue 3, TypeScript.</p> </section> </template>
⋯ 1 unchanged lines export default defineNuxtConfig({ compatibilityDate: "2025-07-15", devtools: { enabled: true },+ modules: ["@pinia/nuxt"], css: ["~/assets/css/main.css"], });
Project files
.gitignoreREADME.mdapp/app.vueapp/assets/css/main.cssapp/components/CounterCard.vueapp/pages/about.vueapp/pages/index.vueapp/stores/counter.tsnuxt.config.tspackage.jsonpublic/robots.txttsconfig.json