Pinia คือไลบรารีจัดการสถานะอย่างเป็นทางการของ Vue (สืบทอดมาจาก Vuex) — store ที่รวมศูนย์สำหรับสถานะที่ต้องแบ่งปันระหว่างหลายคอมโพเนนต์ พร้อม API ที่เรียบง่ายและปลอดภัยในด้านประเภท ที่สร้างขึ้นจาก Composition API
การกำหนด store
{ defineStore } ;
{ ref, computed } ;
useCounterStore = (, {
count = ();
double = ( count. * );
() { count.++; }
() { count. = api.(); }
{ count, double, increment, fetchInitial };
});
