mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
24 lines
501 B
JavaScript
24 lines
501 B
JavaScript
import { appUrl } from '@/services/ApiService'
|
|
import axios from 'axios'
|
|
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
|
|
export const usePanelStore = defineStore('panel', () => {
|
|
const list = ref([])
|
|
|
|
const getPanels = async () => {
|
|
console.log(list.value.length)
|
|
|
|
if (list.value.length > 0) return list.value
|
|
|
|
const resp = await axios.post(appUrl() + '/panel/list')
|
|
list.value = resp.data.data
|
|
|
|
return list.value
|
|
}
|
|
|
|
return {
|
|
list,
|
|
getPanels,
|
|
}
|
|
})
|