27 lines
575 B
JavaScript
27 lines
575 B
JavaScript
|
|
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,
|
||
|
|
}
|
||
|
|
})
|