mirror of
https://github.com/yangzongzhuan/RuoYi-App.git
synced 2025-09-27 22:52:40 +00:00
使用Pinia代替Vuex进行数据存储
This commit is contained in:
13
store/modules/config.js
Normal file
13
store/modules/config.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useConfigStore = defineStore('config', () => {
|
||||
const config = ref()
|
||||
const setConfig = (val) => {
|
||||
config.value = val
|
||||
}
|
||||
return {
|
||||
config,
|
||||
setConfig
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user