From ac7caf141f2ec0cf9aba972b8c83338d064c7d3f Mon Sep 17 00:00:00 2001 From: ccbikai Date: Sun, 16 Mar 2025 13:17:30 +0800 Subject: [PATCH] fix: correct link copy function and add i18n support - Updates shortLink copy function to use .value for reactive reference - Adds i18n translation support in Editor component The copy function was trying to access the shortLink directly instead of its value, which would fail in Vue's reactive system. This fix ensures proper reactivity handling when copying links. --- components/dashboard/links/Editor.vue | 1 + components/dashboard/links/Link.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/dashboard/links/Editor.vue b/components/dashboard/links/Editor.vue index a66b9b9..90113d7 100644 --- a/components/dashboard/links/Editor.vue +++ b/components/dashboard/links/Editor.vue @@ -16,6 +16,7 @@ const props = defineProps({ const emit = defineEmits(['update:link']) +const { t } = useI18n() const link = ref(props.link) const dialogOpen = ref(false) diff --git a/components/dashboard/links/Link.vue b/components/dashboard/links/Link.vue index 132726a..4b36f53 100644 --- a/components/dashboard/links/Link.vue +++ b/components/dashboard/links/Link.vue @@ -34,7 +34,7 @@ function updateLink(link, type) { } function copyLink() { - copy(shortLink) + copy(shortLink.value) toast(t('links.copy_success')) }