Svelte is supporting?
xarhang opened this issue · 2 comments
xarhang commented
when i try in svelte it not work.... please anyone help me to use it on svelteJs
binsarjr commented
I have just converted https://github.com/kozakdenys/qr-code-styling to a Svelte action and added support for reactivity. check here https://www.npmjs.com/package/svelte-qrcode-action
JeremyDarbellay commented
made it work with onMount and dynamic import !
let qrcc;
onMount(async () => {
const module = await import('qr-code-styling')
const QRCodeStyling = module.default
const qrCode = new QRCodeStyling({ options });
let blob = await qrCode.getRawData()
qrcc = URL.createObjectURL(blob);
});
In your component : {#await qrcc then qrcc}<img src={qrcc} alt="your alt" />{/await}