kozakdenys/qr-code-styling

Svelte is supporting?

xarhang opened this issue · 2 comments

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

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

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}