diff options
-rw-r--r-- | src/tools/mac-address-lookup/mac-address-lookup.vue | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/mac-address-lookup/mac-address-lookup.vue b/src/tools/mac-address-lookup/mac-address-lookup.vue index 32b6af5..f3d9cd5 100644 --- a/src/tools/mac-address-lookup/mac-address-lookup.vue +++ b/src/tools/mac-address-lookup/mac-address-lookup.vue @@ -24,7 +24,7 @@ </n-form-item> <n-space justify="center"> - <c-button :disabled="!details"> Copy vendor info </c-button> + <c-button :disabled="!details" @click="copy"> Copy vendor info </c-button> </n-space> </div> </template> @@ -32,6 +32,7 @@ <script setup lang="ts"> import db from 'oui/oui.json'; import { macAddressValidation } from '@/utils/macAddress'; +import { useCopy } from '@/composable/copy'; const getVendorValue = (address: string) => address.trim().replace(/[.:-]/g, '').toUpperCase().substring(0, 6); @@ -39,6 +40,8 @@ const macAddress = ref('20:37:06:12:34:56'); const details = computed<string | undefined>(() => db[getVendorValue(macAddress.value)]); const { attrs: validationAttrs } = macAddressValidation(macAddress); + +const { copy } = useCopy({ source: details, text: 'Vendor info copied to the clipboard' }); </script> <style lang="less" scoped></style> |