yn_img_tools_app/src/stores/modules/common.js

27 lines
575 B
JavaScript
Raw Normal View History

2025-04-07 11:27:47 +08:00
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useCommonStore = defineStore('common', () => {
// 项目数据
const projectList = ref([])
// 专业数据
const majorList = ref([])
// 存储项目数据
const setProjectList = (val) => {
projectList.value = val
}
// 存储专业数据
const setMajorList = (val) => {
majorList.value = val
}
// 把数据和方法 return 出去
return {
projectList,
majorList,
setProjectList,
setMajorList,
}
})