import { defineStore } from 'pinia';

export const useStore = defineStore('state-mgt-store', {
  state: () => {
    return { rows: [] as any[] };
  },
  // 也可以这样定义
  // state: () => ({ count: 0 })
  getters: {},
  actions: {
    setRows(data: any[]) {
      this.rows = data;
    },
    addOne(data: any) {
      this.rows.push(data);
    },
  },
});
