公司官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
592 B

import { defineStore } from 'pinia'
import { ref, computed, reactive } from 'vue'
import api from '@/api'
// 定义案例数据存储
export const useConfigStore = defineStore('config', () => {
const configParams = reactive({})
const map = {
0 : 'text',
1 : 'content',
2 : 'imageUrl',
}
const getConfigParams = async () => {
const res = await api.fetchConfigParams()
res.forEach(item => {
configParams[item.code] = item[map[item.type]]
})
}
return {
configParams,
getConfigParams
}
})