index.ts 327 B

123456789101112131415161718
  1. import { defineStore } from 'pinia';
  2. type AppRootState = {
  3. liveStatus: boolean;
  4. };
  5. export const useAppStore = defineStore('app', {
  6. state: (): AppRootState => {
  7. return {
  8. liveStatus: false,
  9. };
  10. },
  11. actions: {
  12. setLiveStatus(res: AppRootState['liveStatus']) {
  13. this.liveStatus = res;
  14. },
  15. },
  16. });