iopProject
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
|
||||
import { defineStore } from 'pinia'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import zhTw from 'element-plus/dist/locale/zh-tw.mjs'
|
||||
export const ipoStore = defineStore({
|
||||
id: 'app',
|
||||
state: () => ({
|
||||
//1代表英文 2代表繁体中文 3代表简体中文
|
||||
locale:1
|
||||
}),
|
||||
getters: {
|
||||
localeLang(state) {
|
||||
return [en,zhTw,zhCn][state.locale-1];
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
//更改语言的方法
|
||||
setLocale(data: number) {
|
||||
this.locale = data
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user