fave3722 3 years ago
parent
commit
5a3f3cbc71
  1. 25
      src/components/table/desktop/tokensDetails.vue

25
src/components/table/desktop/tokensDetails.vue

@ -7,7 +7,9 @@
>
<p class="underline text-blue-65B5FF">{{ currentData?.address }}</p>
<div class="flex flex-row">
<div @click="handleCopy">
<Icons :url="'copyAddress'" :size="32" />
</div>
<div @click="open">
<Icons :url="'qrCode'" :size="32" class="ml-[16px]" />
</div>
@ -25,14 +27,16 @@
</template>
<script setup lang="ts">
import { onMounted, ref, watchEffect } from 'vue'
import { ElMessageBox } from 'element-plus'
import { ref, watchEffect } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import Qrcode from 'qrcode'
import tokensDetailsRow from '../dBase/tokensDetailsRow.vue'
import { tokensDetailsCollocate } from '../constant'
import Icons from '@src/components/icons/index.vue'
import { useRoute } from 'vue-router'
import { getAddressInfo } from '@src/api/AddressController'
import useClipboard from 'vue-clipboard3'
const invariable = {
...tokensDetailsCollocate,
}
@ -65,7 +69,7 @@ watchEffect(() => {
})
let open = async () => {
const res = await Qrcode.toDataURL('https://baidu.com' as string)
const res = await Qrcode.toDataURL(currentData.value?.address as string)
//
ElMessageBox.alert(`<img src="${res}" class="w-[318px]" />`, {
showClose: false,
@ -76,6 +80,21 @@ let open = async () => {
customClass: 'bg-modal-wrap',
})
}
//
const { toClipboard } = useClipboard()
const handleCopy = async () => {
try {
await toClipboard(currentData.value?.address as string)
ElMessage({
message: 'copy success!',
type: 'success',
})
} catch (error) {
console.log(error)
}
}
</script>
<style lang="scss">

Loading…
Cancel
Save