update frontend with bulma css and home&404 pages
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return { count, doubleCount, increment }
|
||||
})
|
||||
26
frontend/src/stores/global.ts
Normal file
26
frontend/src/stores/global.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { Language } from '@/utils/i18n'
|
||||
|
||||
export const useLanguageStore = defineStore('language', {
|
||||
state: () => ({
|
||||
language: Language.English
|
||||
}),
|
||||
|
||||
getters: {
|
||||
isEnglish: (state) => state.language === Language.English,
|
||||
isSimplifiedChinese: (state) => state.language === Language.SimplifiedChinese,
|
||||
},
|
||||
|
||||
actions: {
|
||||
changeLanguage(lang: Language) {
|
||||
this.language = lang;
|
||||
},
|
||||
changeToEnglish() {
|
||||
this.changeLanguage(Language.English);
|
||||
},
|
||||
changeToSimplifiedChinese() {
|
||||
this.changeLanguage(Language.SimplifiedChinese);
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user