mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 15:29:26 +00:00
WIP: panel management uix
This commit is contained in:
parent
0d3fb09310
commit
58de6eb976
5 changed files with 276 additions and 3 deletions
24
fe/src/stores/panel.js
Normal file
24
fe/src/stores/panel.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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,
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue