mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 23:25:03 -04:00
feat(ipv4-range-expander): remove old component copyable-ip-like.vue
This commit is contained in:
parent
0b7ba4fbfe
commit
fd6c71ba12
1 changed files with 0 additions and 35 deletions
|
@ -1,35 +0,0 @@
|
||||||
<template>
|
|
||||||
<n-tooltip trigger="hover">
|
|
||||||
<template #trigger>
|
|
||||||
<span class="ip" @click="handleClick">{{ ip }}</span>
|
|
||||||
</template>
|
|
||||||
{{ tooltipText }}
|
|
||||||
</n-tooltip>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { useClipboard } from '@vueuse/core';
|
|
||||||
import { ref, toRefs } from 'vue';
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{ ip?: string }>(), { ip: '' });
|
|
||||||
const { ip } = toRefs(props);
|
|
||||||
|
|
||||||
const initialText = 'Copy to clipboard';
|
|
||||||
const tooltipText = ref(initialText);
|
|
||||||
|
|
||||||
const { copy } = useClipboard({ source: ip });
|
|
||||||
|
|
||||||
function handleClick() {
|
|
||||||
copy();
|
|
||||||
tooltipText.value = 'Copied!';
|
|
||||||
|
|
||||||
setTimeout(() => (tooltipText.value = initialText), 1000);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
.ip {
|
|
||||||
font-family: monospace;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Add table
Add a link
Reference in a new issue