qr-code-styling icon indicating copy to clipboard operation
qr-code-styling copied to clipboard

Svelte is supporting?

Open xarhang opened this issue 1 year ago • 2 comments

when i try in svelte it not work.... please anyone help me to use it on svelteJs

xarhang avatar Jun 30 '23 03:06 xarhang

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

binsarjr avatar Jul 22 '23 19:07 binsarjr

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}

JeremyDarbellay avatar Oct 07 '23 16:10 JeremyDarbellay