diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index dcf865c5..9b3a3cad 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -40,8 +40,8 @@ "fullscreen": false, "resizable": true, "title": "shion", - "width": 800, - "height": 600 + "width": 960, + "height": 540 } ] } diff --git a/src/components.d.ts b/src/components.d.ts index aa65ba55..7305aeeb 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -9,10 +9,17 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + AButton: typeof import('ant-design-vue/es')['Button'] + ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] + AForm: typeof import('ant-design-vue/es')['Form'] + AFormItem: typeof import('ant-design-vue/es')['FormItem'] + AInput: typeof import('ant-design-vue/es')['Input'] + AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] ALayout: typeof import('ant-design-vue/es')['Layout'] ALayoutSider: typeof import('ant-design-vue/es')['LayoutSider'] AMenu: typeof import('ant-design-vue/es')['Menu'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] + ASelect: typeof import('ant-design-vue/es')['Select'] NavDrawer: typeof import('./components/NavDrawer.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/src/components/NavDrawer.vue b/src/components/NavDrawer.vue index dfc3f8f8..439720f1 100644 --- a/src/components/NavDrawer.vue +++ b/src/components/NavDrawer.vue @@ -2,7 +2,7 @@ const { t } = useI18n() const route = useRoute() -const menu = [{ +const menu = computed(() => [{ icon: 'i-mdi:view-grid', key: 'index', tip: t('nav.plan'), @@ -12,12 +12,17 @@ const menu = [{ key: 'time', tip: t('nav.time'), to: '/time', +}, { + icon: 'i-mdi:label', + key: 'label', + tip: t('nav.label'), + to: '/label', }, { icon: 'i-mdi:cog', key: 'config', tip: t('nav.config'), to: '/config', -}] +}]) const name = computed(() => route.name as string) diff --git a/src/hooks/useConfig.ts b/src/hooks/useConfig.ts index e14f6267..fb3a8fb4 100644 --- a/src/hooks/useConfig.ts +++ b/src/hooks/useConfig.ts @@ -27,10 +27,9 @@ export function useConfig() { async function init() { const len = await store.length() - if (len != 0) - return + if (len == 0) + await create() - await create() await read() } diff --git a/src/locales/en-US.yaml b/src/locales/en-US.yaml index 3224d2c5..e1d75b79 100644 --- a/src/locales/en-US.yaml +++ b/src/locales/en-US.yaml @@ -1,4 +1,7 @@ nav: - plan: plan - time: time - config: config + plan: Plan + time: Time + label: Label + config: Config +config: + locale: Language diff --git a/src/locales/zh-CN.yaml b/src/locales/zh-CN.yaml index d6cb975a..54fcff03 100644 --- a/src/locales/zh-CN.yaml +++ b/src/locales/zh-CN.yaml @@ -1,4 +1,7 @@ nav: plan: 计划 time: 计时 + label: 标签 config: 设置 +config: + locale: 语言 diff --git a/src/pages/config.vue b/src/pages/config.vue index 9b72b904..2a9ee965 100644 --- a/src/pages/config.vue +++ b/src/pages/config.vue @@ -1,3 +1,35 @@ + + diff --git a/src/pages/label.vue b/src/pages/label.vue new file mode 100644 index 00000000..b158cfac --- /dev/null +++ b/src/pages/label.vue @@ -0,0 +1,3 @@ +