fix(frontend): comprehensive i18n cleanup and Select component hardening

This commit is contained in:
IanShaw027
2026-01-04 21:09:14 +08:00
parent c86d445cb7
commit d36392b74f
12 changed files with 374 additions and 188 deletions

View File

@@ -1,5 +1,8 @@
import { ref } from 'vue'
import { useAppStore } from '@/stores/app'
import { i18n } from '@/i18n'
const { t } = i18n.global
/**
* 检测是否支持 Clipboard API需要安全上下文HTTPS/localhost
@@ -31,7 +34,7 @@ export function useClipboard() {
const copyToClipboard = async (
text: string,
successMessage = 'Copied to clipboard'
successMessage?: string
): Promise<boolean> => {
if (!text) return false
@@ -50,12 +53,12 @@ export function useClipboard() {
if (success) {
copied.value = true
appStore.showSuccess(successMessage)
appStore.showSuccess(successMessage || t('common.copiedToClipboard'))
setTimeout(() => {
copied.value = false
}, 2000)
} else {
appStore.showError('Copy failed')
appStore.showError(t('common.copyFailed'))
}
return success