mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-10 10:10:58 +08:00
Refactor site import/export feature with improved toast notifications
Co-authored-by: jxxghp <jxxghp@live.cn>
This commit is contained in:
@@ -12,6 +12,9 @@ const { t } = useI18n()
|
||||
// 显示器宽度
|
||||
const display = useDisplay()
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@@ -23,8 +26,7 @@ const props = defineProps({
|
||||
// 注册事件
|
||||
const emit = defineEmits(['update:modelValue', 'import-success'])
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
|
||||
// 是否拖拽中
|
||||
const isDragging = ref(false)
|
||||
|
||||
@@ -11,10 +11,14 @@ import { useDisplay } from 'vuetify'
|
||||
import { useDynamicButton } from '@/composables/useDynamicButton'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { usePWA } from '@/composables/usePWA'
|
||||
import { useToast } from 'vue-toastification'
|
||||
|
||||
// 国际化
|
||||
const { t } = useI18n()
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 路由
|
||||
const route = useRoute()
|
||||
|
||||
@@ -260,15 +264,9 @@ async function exportSites() {
|
||||
URL.revokeObjectURL(url)
|
||||
|
||||
// 显示成功提示
|
||||
const { t } = useI18n()
|
||||
const { useToast } = await import('vue-toastification')
|
||||
const $toast = useToast()
|
||||
$toast.success(t('site.messages.exportSuccess'))
|
||||
} catch (error) {
|
||||
console.error('Export sites failed:', error)
|
||||
const { t } = useI18n()
|
||||
const { useToast } = await import('vue-toastification')
|
||||
const $toast = useToast()
|
||||
$toast.error(t('site.messages.exportFailed'))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user