Composition API
vue
<script setup>
import { ref } from 'vue';
const count = ref(0);
</script>
<template>
<button @click="count++">{{ count }}</button>
</template>Pinia State Management
javascript
import { defineStore } from 'pinia';
export const useUserStore = defineStore('user', {
state: () => ({ user: null }),
actions: {
setUser(user) { this.user = user; }
}
});The progressive framework!