Sign in

cnlive_project / cnlive-community-web-vue · Files

GitLab

  • Back to group
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • cnlive-community-web-vue
  • src
  • pinia
  • app.ts
  • pinia优化
    0831d929
    杨泽宇 authored
    2022-01-28 15:37:56 +0800  
    Browse Code »
app.ts 333 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import { defineStore } from 'pinia'

export const useAppStore = defineStore({
  id: 'app',
  state: () => {
    return {
      isCollapse: false,
    }
  },
  actions: {
    toggleCollapse() {
      this.isCollapse = !this.isCollapse
    },
  },
  getters: {
    getCollapseStatus (state) {
      return state.isCollapse
    }
  }
})