mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-10-23 04:52:14 +00:00
* feat(case converter): add uppercase and lowercase * (case converter) correctly use stripRegexp * style: lint fix * feat(ui): added c-select in the ui lib (#550) * feat(ui): added c-select in the ui lib * refactor(ui): switched n-select to c-select * feat(new tool): emoji picker (#551) * chore(deps): update dependency @vitejs/plugin-vue to v4 (#496) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency @vitejs/plugin-vue-jsx to v3 (#497) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * refactor(case converter): using nocase to convert to upper and lower case * refactor(case converter): config based case changes --------- Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
36 lines
867 B
Vue
36 lines
867 B
Vue
<script setup lang="ts">
|
|
import { useClipboard, useVModel } from '@vueuse/core';
|
|
|
|
const props = defineProps<{ value: string }>();
|
|
const emit = defineEmits(['update:value']);
|
|
|
|
const value = useVModel(props, 'value', emit);
|
|
const tooltipText = ref('Copy to clipboard');
|
|
|
|
const { copy } = useClipboard({ source: value });
|
|
|
|
function onCopyClicked() {
|
|
copy();
|
|
tooltipText.value = 'Copied!';
|
|
|
|
setTimeout(() => {
|
|
tooltipText.value = 'Copy to clipboard';
|
|
}, 2000);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<c-input-text v-model:value="value">
|
|
<template #suffix>
|
|
<n-tooltip trigger="hover">
|
|
<template #trigger>
|
|
<c-button circle variant="text" size="small" @click="onCopyClicked">
|
|
<icon-mdi-content-copy />
|
|
</c-button>
|
|
</template>
|
|
{{ tooltipText }}
|
|
</n-tooltip>
|
|
</template>
|
|
</c-input-text>
|
|
</template>
|