coppy to clipboard

This commit is contained in:
2023-07-26 15:37:10 +02:00
parent dcb3c445bd
commit b92afbe3e1

View File

@@ -21,6 +21,8 @@ const computedResult = computed(() => {
sell_ratio: r.sell === 0 ? 1 : (r.sell_reprocess / r.sell) - 1
})).sort((a, b) => a.name.localeCompare(b.name))
})
const copyToClipboard = (s: string) => navigator.clipboard.writeText(s);
</script>
<template>
@@ -41,7 +43,7 @@ const computedResult = computed(() => {
</tr>
</thead>
<tbody>
<tr v-for="r in computedResult" :key="r.typeID" :class="{'bg-emerald-500': r.buy_ratio >= threshold / 100 }">
<tr v-for="r in computedResult" :key="r.typeID" class="cursor-pointer" :class="{'bg-emerald-500': r.buy_ratio >= threshold / 100 }" @click="copyToClipboard(r.name)">
<td>{{ r.name }}</td>
<td class="text-right">{{ iskFormater.format(r.buy) }}</td>
<td class="text-right">{{ iskFormater.format(r.buy_reprocess) }} ({{percentFormater.format(r.buy_ratio)}})</td>