mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
feat: 完成布局/仪表板/用户相关组件国际化与语言切换优化(TabBar/MainLayout/AppHeader、UsageTrend/ModelDistribution、User*、Common 组件、i18n/locale 增强)
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
<i :class="getIconClass(toast.type)" />
|
||||
</div>
|
||||
<div class="toast-body">
|
||||
<div v-if="toast.title" class="toast-title">
|
||||
{{ toast.title }}
|
||||
<div v-if="toast.title || getDefaultTitle(toast.type)" class="toast-title">
|
||||
{{ toast.title || getDefaultTitle(toast.type) }}
|
||||
</div>
|
||||
<div class="toast-message">
|
||||
{{ toast.message }}
|
||||
@@ -35,6 +35,9 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
// 状态
|
||||
const toasts = ref([])
|
||||
@@ -51,6 +54,11 @@ const getIconClass = (type) => {
|
||||
return iconMap[type] || iconMap.info
|
||||
}
|
||||
|
||||
// 获取默认标题
|
||||
const getDefaultTitle = (type) => {
|
||||
return t(`common.toastNotification.defaultTitles.${type}`)
|
||||
}
|
||||
|
||||
// 添加Toast
|
||||
const addToast = (message, type = 'info', title = null, duration = 5000) => {
|
||||
const id = ++toastIdCounter
|
||||
|
||||
Reference in New Issue
Block a user