Files
2026-06-06 18:43:00 +08:00

23 lines
424 B
JavaScript

import { defineStore } from 'pinia'
export const useNetworkStore = defineStore('network', {
state: () => ({
isOnline: navigator.onLine,
isLoading: false
}),
actions: {
setOnline(status) {
this.isOnline = status
if (status) {
this.isLoading = false
}
},
startLoading() {
this.isLoading = true
},
stopLoading() {
this.isLoading = false
}
}
})