From 4f727ffcc182b9b792f50bc60a91389304e07c54 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 30 May 2024 22:40:41 +0300 Subject: [PATCH] Added the ability to pass alt text for the img version of the barcode --- README.md | 7 +++++++ src/Barcode.svelte | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bb657d3..aad6cc8 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,13 @@ yarn add svelte-barcode --save ❌ Overide the text that is diplayed + + altText + string? + value prop + ❌ + Overide the alt text for an img barcode. + fontOptions string? diff --git a/src/Barcode.svelte b/src/Barcode.svelte index ca35302..179b27e 100644 --- a/src/Barcode.svelte +++ b/src/Barcode.svelte @@ -40,7 +40,7 @@ {#if elementTag === 'img'} - + {options.altText || value} {:else if elementTag === 'canvas'} {:else}