diff --git a/src/App.vue b/src/App.vue index 0ae533c..7b180aa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,20 +10,18 @@ import { storeToRefs } from 'pinia'; import { useRouter } from 'vue-router'; import YDropDown from '@/components/ui/DropDown.vue'; -const router = useRouter(); const userStore = useUserStore(); userStore.setProfile(); userStore.setConfig(); const useConfig = useConfigStore(); const { config } = storeToRefs(userStore); -const { currentSystem, onlyShowMain } = storeToRefs(useConfig); +const { onlyShowMain } = storeToRefs(useConfig); setTheme(getTheme()); const obj = reactive({ showChangeFontModal: false, - showChangeSystemModal: false, userName: '', password: '', userNameError: '', @@ -75,10 +73,6 @@ const changeTheme = () => { const currentTheme = getTheme(); currentTheme === 'light' ? setTheme('dark') : setTheme('light'); }; - -function changeSystem(system: string) { - useConfig.setCurrentSystem(system); -} - - - - - - diff --git a/src/store/config.ts b/src/store/config.ts index 02f40d3..aa3944b 100644 --- a/src/store/config.ts +++ b/src/store/config.ts @@ -3,9 +3,7 @@ import { defineStore } from 'pinia'; export const useConfigStore = defineStore('config', { state: () => ({ onlyShowMain: false as boolean, - currentSystem: 'win' as string, // win, mac currentFont: 'default' as string, - keyboardModalStatus: false as boolean, printContent: '' as string, currentCode: [] as any[] }), @@ -13,15 +11,9 @@ export const useConfigStore = defineStore('config', { setOnlyShowMain(val: boolean) { this.onlyShowMain = val; }, - setCurrentSystem(val: string) { - this.currentSystem = val; - }, setCurrentFont(val: string) { this.currentFont = val; }, - setKeyboardModalStatus(val: boolean) { - this.keyboardModalStatus = val; - }, setPrintContent(val: string) { this.printContent += val; }, diff --git a/src/view/TypingKeyboard.vue b/src/view/TypingKeyboard.vue index 7a6ab73..1cf7e91 100644 --- a/src/view/TypingKeyboard.vue +++ b/src/view/TypingKeyboard.vue @@ -10,11 +10,12 @@ import YModal from '@/components/ui/Modal.vue'; const screenBottomRef = ref(); const state = reactive({ currentKeyBoard: 'standard', // '68' | 'standard' - currentSystem: 'win' // 'mac' | 'win' + currentSystem: 'win', // 'mac' | 'win' + keyboardModal: false }); const configStore = useConfigStore(); -const { printContent, keyboardModalStatus, currentCode, currentSystem } = storeToRefs(configStore); +const { printContent, currentCode, onlyShowMain } = storeToRefs(configStore); let timeout: any = null; @@ -50,6 +51,25 @@ const changeKeyboard = (keyboard: string) => { >
+ +
+
+ Windows +
+
+ Mac +
+
切换键盘
+
+
{ @@ -84,8 +104,8 @@ const changeKeyboard = (keyboard: string) => { @@ -96,9 +116,9 @@ const changeKeyboard = (keyboard: string) => {