From 953c13cdd3b9e0c0c0801e6c4b79f8b17e5d2af5 Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Fri, 9 Jun 2023 18:22:45 +0800 Subject: [PATCH] new feature: full screen alert --- .../KUNGalgameAlert/KUNGalgameAlert.vue | 132 ++++++++++++++++++ .../setting-panel/KUNGalgameSettingPanel.vue | 2 +- src/language/en.ts | 5 + src/language/zh.ts | 5 + src/utils/toggle.ts | 18 +++ src/views/edit/components/Button.vue | 22 ++- src/views/edit/components/Tags.vue | 2 +- 7 files changed, 178 insertions(+), 8 deletions(-) create mode 100644 src/components/KUNGalgameAlert/KUNGalgameAlert.vue create mode 100644 src/utils/toggle.ts diff --git a/src/components/KUNGalgameAlert/KUNGalgameAlert.vue b/src/components/KUNGalgameAlert/KUNGalgameAlert.vue new file mode 100644 index 00000000..f469d7af --- /dev/null +++ b/src/components/KUNGalgameAlert/KUNGalgameAlert.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/src/components/setting-panel/KUNGalgameSettingPanel.vue b/src/components/setting-panel/KUNGalgameSettingPanel.vue index 8f425938..c5dadb0a 100644 --- a/src/components/setting-panel/KUNGalgameSettingPanel.vue +++ b/src/components/setting-panel/KUNGalgameSettingPanel.vue @@ -189,7 +189,7 @@ const handleRecover = () => { border: 1px solid var(--kungalgame-blue-4); background-color: var(--kungalgame-trans-white-9); option { - background-color: var(--kungalgame-trans-white-9); + background-color: var(--kungalgame-white); } } .page-width { diff --git a/src/language/en.ts b/src/language/en.ts index 2d5ddd44..567e2221 100644 --- a/src/language/en.ts +++ b/src/language/en.ts @@ -106,4 +106,9 @@ export default { contact: { title: 'Join / Contact Us', }, + // 非页面组件这里统一用大驼峰 + ComponentAlert: { + confirm: 'OK', + cancel: 'Cancel', + }, } diff --git a/src/language/zh.ts b/src/language/zh.ts index 5f85c1b8..45239333 100644 --- a/src/language/zh.ts +++ b/src/language/zh.ts @@ -106,4 +106,9 @@ export default { contact: { title: '加入 / 联系我们', }, + // 非页面组件这里统一用大驼峰 + ComponentAlert: { + confirm: '确定', + cancel: '取消', + }, } diff --git a/src/utils/toggle.ts b/src/utils/toggle.ts new file mode 100644 index 00000000..9a5d4d6d --- /dev/null +++ b/src/utils/toggle.ts @@ -0,0 +1,18 @@ +import { ref } from 'vue' + +const toggleStatus = (initState: boolean, delay: number) => { + const on = ref(initState ?? false) + + const toggle = (value: boolean) => { + setTimeout(() => { + on.value = value ?? !on.value + }, delay) + } + + return { + on, + toggle, + } +} + +export default toggleStatus diff --git a/src/views/edit/components/Button.vue b/src/views/edit/components/Button.vue index 11a6d179..5612ba1f 100644 --- a/src/views/edit/components/Button.vue +++ b/src/views/edit/components/Button.vue @@ -1,4 +1,11 @@ - +