app.js 371 B

12345678910111213141516171819
  1. import { defineStore } from 'pinia'
  2. import { ref } from 'vue'
  3. export const useAppStore = defineStore('app', () => {
  4. // 全局加载状态
  5. const loading = ref(false)
  6. // 系统信息
  7. const systemInfo = ref(uni.getSystemInfoSync())
  8. const setLoading = (status) => {
  9. loading.value = status
  10. }
  11. return {
  12. loading,
  13. systemInfo,
  14. setLoading
  15. }
  16. })