This commit is contained in:
steffenrapp 2024-08-27 17:02:01 +00:00
parent 867d415fea
commit 42170052ec

View file

@ -10,23 +10,20 @@ 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<{
value: string
followHeightOf?: HTMLElement | null
language?: string
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
copyMessage?: string
}>();
const { t } = useI18n(); const { t } = useI18n();
// eslint-disable-next-line vue/define-macros-order const defaultProps = withDefaults(props, {
const props = withDefaults( followHeightOf: null,
defineProps<{ language: 'txt',
value: string copyPlacement: 'top-right',
followHeightOf?: HTMLElement | null copyMessage: t('copyClipboard.tooltip'),
language?: string });
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
copyMessage?: string
}>(),
{
followHeightOf: null,
language: 'txt',
copyPlacement: 'top-right',
copyMessage: t('copyClipboard.tooltip'),
},
);
hljs.registerLanguage('sql', sqlHljs); hljs.registerLanguage('sql', sqlHljs);
hljs.registerLanguage('json', jsonHljs); hljs.registerLanguage('json', jsonHljs);