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.
This commit is contained in:
ccbikai 2025-03-16 13:17:30 +08:00
parent 71654dcbc8
commit ac7caf141f
2 changed files with 2 additions and 1 deletions

View file

@ -16,6 +16,7 @@ const props = defineProps({
const emit = defineEmits(['update:link'])
const { t } = useI18n()
const link = ref(props.link)
const dialogOpen = ref(false)

View file

@ -34,7 +34,7 @@ function updateLink(link, type) {
}
function copyLink() {
copy(shortLink)
copy(shortLink.value)
toast(t('links.copy_success'))
}
</script>