mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
feat(frontend): add link to download QR-Code
This commit is contained in:
parent
df87f9c105
commit
b3d935af4a
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="figure-qr-code">
|
<div class="figure-qr-code">
|
||||||
<div class="qrbox">
|
<div class="qrbox">
|
||||||
<q-r-canvas :options="options" class="canvas" />
|
<q-r-canvas :options="options" class="canvas mb-4" id="qrcanvas" />
|
||||||
|
<a id="download" download="GradidoLinkQRCode.png" href="" @click="downloadImg(this)">
|
||||||
|
{{ $t('download') }}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -37,6 +40,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
downloadImg() {
|
||||||
|
const canvas = document.getElementById('qrcanvas')
|
||||||
|
const image = canvas.toDataURL('image/png')
|
||||||
|
document.getElementById('download').href = image
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user