mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 13:29:13 -04:00
fix
This commit is contained in:
parent
42170052ec
commit
ff46f178ce
3 changed files with 16 additions and 22 deletions
|
@ -78,9 +78,6 @@ toolCard:
|
||||||
new: Neu
|
new: Neu
|
||||||
search:
|
search:
|
||||||
label: Suche
|
label: Suche
|
||||||
copyClipboard:
|
|
||||||
tooltip: In die Zwischenablage kopieren
|
|
||||||
success: Kopiert!
|
|
||||||
tools:
|
tools:
|
||||||
categories:
|
categories:
|
||||||
favorite-tools: Deine Lieblingstools
|
favorite-tools: Deine Lieblingstools
|
||||||
|
|
|
@ -72,9 +72,6 @@ toolCard:
|
||||||
new: New
|
new: New
|
||||||
search:
|
search:
|
||||||
label: Search
|
label: Search
|
||||||
copyClipboard:
|
|
||||||
tooltip: Copy to clipboard
|
|
||||||
success: Copied!
|
|
||||||
tools:
|
tools:
|
||||||
categories:
|
categories:
|
||||||
favorite-tools: Your favorite tools
|
favorite-tools: Your favorite tools
|
||||||
|
|
|
@ -10,21 +10,21 @@ import iniHljs from 'highlight.js/lib/languages/ini';
|
||||||
import markdownHljs from 'highlight.js/lib/languages/markdown';
|
import markdownHljs from 'highlight.js/lib/languages/markdown';
|
||||||
import { useCopy } from '@/composable/copy';
|
import { useCopy } from '@/composable/copy';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = withDefaults(
|
||||||
value: string
|
defineProps<{
|
||||||
followHeightOf?: HTMLElement | null
|
value: string
|
||||||
language?: string
|
followHeightOf?: HTMLElement | null
|
||||||
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
language?: string
|
||||||
copyMessage?: string
|
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
||||||
}>();
|
copyMessage?: string
|
||||||
const { t } = useI18n();
|
}>(),
|
||||||
const defaultProps = withDefaults(props, {
|
{
|
||||||
followHeightOf: null,
|
followHeightOf: null,
|
||||||
language: 'txt',
|
language: 'txt',
|
||||||
copyPlacement: 'top-right',
|
copyPlacement: 'top-right',
|
||||||
copyMessage: t('copyClipboard.tooltip'),
|
copyMessage: 'Copy to clipboard',
|
||||||
});
|
},
|
||||||
|
);
|
||||||
hljs.registerLanguage('sql', sqlHljs);
|
hljs.registerLanguage('sql', sqlHljs);
|
||||||
hljs.registerLanguage('json', jsonHljs);
|
hljs.registerLanguage('json', jsonHljs);
|
||||||
hljs.registerLanguage('html', xmlHljs);
|
hljs.registerLanguage('html', xmlHljs);
|
||||||
|
@ -37,7 +37,7 @@ const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(p
|
||||||
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
|
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
|
||||||
|
|
||||||
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
|
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
|
||||||
const tooltipText = computed(() => isJustCopied.value ? t('copyClipboard.success') : copyMessage.value);
|
const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue