test.js 224 B

123456789101112131415161718
  1. import {
  2. defineStore
  3. } from 'pinia';
  4. export const useTestStore = defineStore({
  5. id: ' test',
  6. state: () => ({
  7. count: 0,
  8. }),
  9. actions: {
  10. increment() {
  11. this.count++;
  12. },
  13. decrement() {
  14. this.count--;
  15. },
  16. },
  17. });