reportStore.js 417 B

123456789101112131415161718192021222324
  1. import { defineStore } from 'pinia'
  2. export const useReportStore = defineStore('report', {
  3. state: () => ({
  4. reportCate: null
  5. }),
  6. actions: {
  7. setReportCate(data) {
  8. this.reportCate = data
  9. },
  10. // 初始化时从Storage加载
  11. loadReportCate() {
  12. this.reportCate = null
  13. },
  14. cleanReportCate() {
  15. this.reportCate = null
  16. }
  17. },
  18. getters: {
  19. isReportCate(state){
  20. return !!state.reportCate;
  21. }
  22. }
  23. })